From dea328b12871b153e6890a02598286871960f328 Mon Sep 17 00:00:00 2001 From: Moises Cardona Date: Mon, 4 May 2020 14:00:16 +0000 Subject: [PATCH] Add -V/-v argument to print software version and platform info --- src/app/exhaleApp.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/exhaleApp.cpp b/src/app/exhaleApp.cpp index edbf134..131d80e 100644 --- a/src/app/exhaleApp.cpp +++ b/src/app/exhaleApp.cpp @@ -83,6 +83,18 @@ int main (const int argc, char* argv[]) return 32768; // bad executable string } + // print program header with compile info in plain text if we pass -V + if (argc > 1 && (strcmp(argv[1], "-V") == 0 || strcmp(argv[1], "-v") == 0)) + { +#if defined (_WIN64) || defined (WIN64) || defined (_LP64) || defined (__LP64__) || defined (__x86_64) || defined (__x86_64__) + fprintf_s(stdout, "exhale %s.%s%s (x64)\n", +#else // 32-bit OS + fprintf_s(stdout, "exhale %s.%s%s (x86)\n", +#endif + EXHALELIB_VERSION_MAJOR, EXHALELIB_VERSION_MINOR, EXHALELIB_VERSION_BUGFIX); + return 0; + } + // print program header with compile info fprintf_s (stdout, "\n ---------------------------------------------------------------------\n"); fprintf_s (stdout, " | ");