Add -V/-v argument to print software version and platform info

This commit is contained in:
Moises Cardona 2020-05-04 14:00:16 +00:00 committed by Christian R. Helmrich
parent e5657c8561
commit dea328b128

View File

@ -83,6 +83,18 @@ int main (const int argc, char* argv[])
return 32768; // bad executable string 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 // print program header with compile info
fprintf_s (stdout, "\n ---------------------------------------------------------------------\n"); fprintf_s (stdout, "\n ---------------------------------------------------------------------\n");
fprintf_s (stdout, " | "); fprintf_s (stdout, " | ");