diff --git a/c6021light/src/ConsoleManager.cpp b/c6021light/src/ConsoleManager.cpp index 3172e9a..014e0c3 100644 --- a/c6021light/src/ConsoleManager.cpp +++ b/c6021light/src/ConsoleManager.cpp @@ -47,6 +47,8 @@ DEFINE_COMMAND_STRING(flash); DEFINE_COMMAND_STRING(dump); DEFINE_COMMAND_STRING(save); DEFINE_COMMAND_STRING(format); + +DEFINE_COMMAND_STRING(version); DEFINE_COMMAND_STRING(help); static constexpr const char* turnoutProtocolHelp{ @@ -60,6 +62,7 @@ int run_app_set_turnout_protocol(int argc, const char* const* argv, int argcMatc int run_app_get_turnout_protocol(int argc, const char* const* argv, int argcMatched); int run_app_save(int argc, const char* const* argv, int argcMatched); int run_app_help(int argc, const char* const* argv, int argcMatched); +int run_app_version(int argc, const char* const* argv, int argcMatched); int run_app_dump_flash(int argc, const char* const* argv, int argcMatched); // implemented in eeprom emulation int run_app_format_flash(int argc, const char* const* argv, @@ -142,6 +145,7 @@ static const cliSupport::Argument argtable[] = { "Control the LocoNet Refresh Slot server."}, {COMMAND(canEngineDB), COMMAND_ARGS(canEngineDB), nullptr, "Control the Can Engine DB."}, {COMMAND(help), nullptr, run_app_help, "Display this help message."}, + {COMMAND(version), nullptr, run_app_version, "Display version information."}, {}}; } // namespace @@ -189,6 +193,11 @@ int run_app_help(int, const char* const*, int) { return 0; } +int run_app_version(int, const char* const*, int) { + display_version(0, nullptr); + return 0; +} + namespace { void printArguments(int argc, const char* const* argv) { for (int i = 0; i < argc; ++i) { @@ -231,6 +240,13 @@ void display_help(int argc, const char* const* argv) { } } +void display_version(int, const char* const*) { + puts("Current Version:"); + puts("fd469d610a70e3e384686cecfb074ee3d4c389b5"); + printf("\n"); +} + + void begin(DataModel* dataModel) { dataModel_ = dataModel; diff --git a/c6021light/src/ConsoleManager.h b/c6021light/src/ConsoleManager.h index 0912ece..2f96a6a 100644 --- a/c6021light/src/ConsoleManager.h +++ b/c6021light/src/ConsoleManager.h @@ -20,6 +20,7 @@ extern microrl_t microrl; void begin(DataModel* dataModel); void display_help(int argc, const char* const* argv); +void display_version(int argc, const char* const* argv); /** * \brief Verify that the expected (range of) number(s) of arguments is available.