Changed to output git ID on --version

Changed from --git to --version option for showing the GitID.
This commit is contained in:
George Smart
2017-03-13 19:17:16 +00:00
committed by GitHub
parent e26fdd6030
commit 9d71de3ae0

View File

@@ -78,24 +78,21 @@ const char* HEADER4 = "Copyright(C) 2015-2017 by Jonathan Naylor, G4KLX and othe
int main(int argc, char** argv)
{
const char* iniFile = DEFAULT_INI_FILE;
if (argc > 1) {
for (int currentArg = 1; currentArg < argc; ++currentArg) {
std::string arg = argv[currentArg];
if ((arg == "-v") || (arg == "--version")) {
::fprintf(stdout, "MMDVMHost version %s\n", VERSION);
return 0;
} else if((arg == "-g") || (arg == "--git")) {
::fprintf(stdout, "MMDVMHost GitID #%.7s\n", gitversion);
return 0;
} else if (arg.substr(0,1) == "-") {
::fprintf(stderr, "Usage: MMDVMHost [-v|--version] [-g|--git] [filename]\n");
return 1;
} else {
iniFile = argv[currentArg];
}
}
}
const char* iniFile = DEFAULT_INI_FILE;
if (argc > 1) {
for (int currentArg = 1; currentArg < argc; ++currentArg) {
std::string arg = argv[currentArg];
if ((arg == "-v") || (arg == "--version")) {
::fprintf(stdout, "MMDVMHost version %s git #%.7s\n", VERSION, gitversion);
return 0;
} else if (arg.substr(0,1) == "-") {
::fprintf(stderr, "Usage: MMDVMHost [-v|--version] [filename]\n");
return 1;
} else {
iniFile = argv[currentArg];
}
}
}
#if !defined(_WIN32) && !defined(_WIN64)
::signal(SIGTERM, sigHandler);