Skip to content

Commit

Permalink
Merge pull request #110 from Habbie/version-obvious
Browse files Browse the repository at this point in the history
make -v print the version in -cli and -lvgl, log version on startup
  • Loading branch information
Habbie authored Oct 4, 2024
2 parents 05b3b87 + 7bd3822 commit eaad4b4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ if get_option('front-ftxui').enabled()
'src/WSConn.cpp',
'src/front-ftxui.cpp',
'src/generated/domains.hpp',
version_file,
],
install: true,
dependencies: [
Expand Down Expand Up @@ -218,6 +219,7 @@ if get_option('front-lvgl').enabled()
'src/front-lvgl.cpp',
'src/lv_conf.h',
'src/generated/domains.hpp',
version_file,
],
install: true,
dependencies: [
Expand Down
2 changes: 1 addition & 1 deletion src/front-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SimpleObserver : public IObserver

void uithread(int _argc, char* _argv[])
{
argparse::ArgumentParser program("voorkant-cli");
argparse::ArgumentParser program("voorkant-cli", getVersion());
argparse::ArgumentParser version_command("version");
program.add_subparser(version_command);
argparse::ArgumentParser subscribe_command("subscribe");
Expand Down
2 changes: 1 addition & 1 deletion src/front-lvgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void lvLogCallback(lv_log_level_t _level, const char* _buf) // FIXME use level

void uithread(int _argc, char* _argv[])
{
argparse::ArgumentParser program("voorkant-lvgl");
argparse::ArgumentParser program("voorkant-lvgl", getVersion());

argparse::ArgumentParser entity_command("entity");
entity_command.add_argument("pattern").help("what entity to render, in a c++ regex");
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main(int argc, char* argv[])
{
g_log.setLogLevel(Logger::LogLevel::Debug);
g_log.setDoDetails(true);
g_log << Logger::LogLevel::Info << "Starting!" << std::endl;
g_log << Logger::LogLevel::Info << "Starting! (version " << getVersion() << ")" << std::endl;
if (HABackend::getInstance().connect({.url = getEnv("HA_WS_URL"), .token = getEnv("HA_API_TOKEN")})) {
g_log << Logger::LogLevel::Debug << "Connected to HA succesfully!" << std::endl;
// we used to do this, which actually is quite pointless if main does nothing besides this (after connecting HA)
Expand Down

0 comments on commit eaad4b4

Please sign in to comment.