From 8a966441abab2bed898daf7f27bac1d2e801832f Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Sun, 1 Sep 2024 13:26:26 +0200 Subject: [PATCH 1/3] make -v print the version in -cli and -lvgl --- meson.build | 1 + src/front-cli.cpp | 2 +- src/front-lvgl.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index e39207b6..b897ae26 100644 --- a/meson.build +++ b/meson.build @@ -213,6 +213,7 @@ if get_option('front-lvgl').enabled() 'src/front-lvgl.cpp', 'src/lv_conf.h', 'src/generated/domains.hpp', + version_file ], install: true, dependencies: [ diff --git a/src/front-cli.cpp b/src/front-cli.cpp index 78f5845f..a1a3f63f 100644 --- a/src/front-cli.cpp +++ b/src/front-cli.cpp @@ -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"); diff --git a/src/front-lvgl.cpp b/src/front-lvgl.cpp index ae7acfa7..fc6f23f5 100644 --- a/src/front-lvgl.cpp +++ b/src/front-lvgl.cpp @@ -62,7 +62,7 @@ void lvLogCallback(const char* buf) 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"); From 75dd7fee55cf13365df6c9a3b216b3e61da6c9a8 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Sun, 1 Sep 2024 13:28:57 +0200 Subject: [PATCH 2/3] log version number before HA connection, also in -ftxui --- meson.build | 1 + src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b897ae26..ee650d89 100644 --- a/meson.build +++ b/meson.build @@ -151,6 +151,7 @@ if get_option('front-ftxui').enabled() 'src/WSConn.cpp', 'src/front-ftxui.cpp', 'src/generated/domains.hpp', + version_file ], install: true, dependencies: [ diff --git a/src/main.cpp b/src/main.cpp index 75debc3a..b627953c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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) From 7bd3822a9fba61936289182af054d984d7efe074 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Fri, 4 Oct 2024 18:13:05 +0200 Subject: [PATCH 3/3] format meson.build --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index ee650d89..19c4b4d3 100644 --- a/meson.build +++ b/meson.build @@ -151,7 +151,7 @@ if get_option('front-ftxui').enabled() 'src/WSConn.cpp', 'src/front-ftxui.cpp', 'src/generated/domains.hpp', - version_file + version_file, ], install: true, dependencies: [ @@ -214,7 +214,7 @@ if get_option('front-lvgl').enabled() 'src/front-lvgl.cpp', 'src/lv_conf.h', 'src/generated/domains.hpp', - version_file + version_file, ], install: true, dependencies: [