From b85d2307e9446aa064be33dc0692b94055195501 Mon Sep 17 00:00:00 2001 From: Seppi Date: Thu, 26 Oct 2017 19:43:20 -0500 Subject: [PATCH 1/2] Adding version command to console --- src/console.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/console.c b/src/console.c index 45bd205..a2f0c93 100644 --- a/src/console.c +++ b/src/console.c @@ -858,6 +858,15 @@ static void onConsoleKeymapCommand(Console* console, const char* param) commandDone(console); } +static void onConsoleVersionCommand(Console* console, const char* param) +{ + printBack(console, "\n"); + char msg[64] = {0}; + sprintf(msg, "%i.%i.%i", TIC_VERSION_MAJOR, TIC_VERSION_MINOR, TIC_VERSION_PATCH); + consolePrint(console, msg, CONSOLE_BACK_TEXT_COLOR); + commandDone(console); +} + static void onConsoleConfigCommand(Console* console, const char* param) { if(param == NULL) @@ -1832,6 +1841,7 @@ static const struct {"demo", NULL, "install demo carts", onConsoleInstallDemosCommand}, {"config", NULL, "edit TIC config", onConsoleConfigCommand}, {"keymap", NULL, "configure keyboard mapping", onConsoleKeymapCommand}, + {"version", NULL, "show the current version", onConsoleVersionCommand}, {"surf", NULL, "open carts browser", onConsoleSurfCommand}, }; From 39296a8fbfd0802661838c9a045a781f1faf054f Mon Sep 17 00:00:00 2001 From: Seppi Date: Mon, 30 Oct 2017 18:25:57 -0500 Subject: [PATCH 2/2] Cleaning up pr #357 --- src/console.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/console.c b/src/console.c index a2f0c93..d661583 100644 --- a/src/console.c +++ b/src/console.c @@ -861,9 +861,7 @@ static void onConsoleKeymapCommand(Console* console, const char* param) static void onConsoleVersionCommand(Console* console, const char* param) { printBack(console, "\n"); - char msg[64] = {0}; - sprintf(msg, "%i.%i.%i", TIC_VERSION_MAJOR, TIC_VERSION_MINOR, TIC_VERSION_PATCH); - consolePrint(console, msg, CONSOLE_BACK_TEXT_COLOR); + consolePrint(console, TIC_VERSION_LABEL, CONSOLE_BACK_TEXT_COLOR); commandDone(console); }