Qt: Parse --version flag

This commit is contained in:
Vicki Pfau 2021-04-15 20:38:58 -07:00
parent 598dbff32f
commit a36e4157c0
1 changed files with 11 additions and 3 deletions

View File

@ -61,9 +61,17 @@ int main(int argc, char* argv[]) {
mSubParser subparser; mSubParser subparser;
initParserForGraphics(&subparser, &graphicsOpts); initParserForGraphics(&subparser, &graphicsOpts);
bool loaded = configController.parseArguments(&args, argc, argv, &subparser); bool loaded = configController.parseArguments(&args, argc, argv, &subparser);
if (loaded && args.showHelp) { if (loaded) {
usage(argv[0], subparser.usage); if (args.showHelp) {
return 0; usage(argv[0], subparser.usage);
freeArguments(&args);
return 0;
}
if (args.showVersion) {
version(argv[0]);
freeArguments(&args);
return 0;
}
} }
QApplication::setApplicationName(projectName); QApplication::setApplicationName(projectName);