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,10 +61,18 @@ int main(int argc, char* argv[]) {
mSubParser subparser;
initParserForGraphics(&subparser, &graphicsOpts);
bool loaded = configController.parseArguments(&args, argc, argv, &subparser);
if (loaded && args.showHelp) {
if (loaded) {
if (args.showHelp) {
usage(argv[0], subparser.usage);
freeArguments(&args);
return 0;
}
if (args.showVersion) {
version(argv[0]);
freeArguments(&args);
return 0;
}
}
QApplication::setApplicationName(projectName);
QApplication::setApplicationVersion(projectVersion);