From 5088db36f44d2b4a60df844be35a85278576aa07 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 11 Oct 2022 12:31:56 +0200 Subject: [PATCH] Added a new command line option to help with generating version.txt for tpz files. --- main/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index 260ebbe4e..c5ae01bba 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -246,6 +246,9 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print("General options:\n"); OS::get_singleton()->print(" -h, --help Display this help message.\n"); OS::get_singleton()->print(" --version Display the version string.\n"); +#ifdef TOOLS_ENABLED + OS::get_singleton()->print(" --version-full-config Display the full config version string (used by the export templates manager).\n"); +#endif OS::get_singleton()->print(" -v, --verbose Use verbose stdout mode.\n"); OS::get_singleton()->print(" --quiet Quiet mode, silences stdout messages. Errors are still displayed.\n"); OS::get_singleton()->print("\n"); @@ -497,6 +500,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph exit_code = ERR_HELP; // Hack to force an early exit in `main()` with a success code. goto error; +#ifdef TOOLS_ENABLED + } else if (I->get() == "--version-full-config") { + print_line(String(VERSION_FULL_CONFIG)); + exit_code = ERR_HELP; // Hack to force an early exit in `main()` with a success code. + goto error; +#endif + } else if (I->get() == "-v" || I->get() == "--verbose") { // verbose output OS::get_singleton()->_verbose_stdout = true;