on xenial help sign in
unity-scope-tool: Use parse instead of process
ba04cc9Albert Astals Cid
tools/scopetool.cpp+6−2
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
59 "Otherwise passing a path to a scope config file will open a session with\n"
59 "Otherwise passing a path to a scope config file will open a session with\n"
60 "only that scope (assuming that the binary implementing the scope can be\n"
60 "only that scope (assuming that the binary implementing the scope can be\n"
61 "found in the same directory as the config file).");
61 "found in the same directory as the config file).");
62− parser.addHelpOption();
62+ QCommandLineOption helpOption = parser.addHelpOption();
63 parser.addPositionalArgument("scopes", "Paths to scope config files to spawn, optionally.", "[scopes...]");
63 parser.addPositionalArgument("scopes", "Paths to scope config files to spawn, optionally.", "[scopes...]");
64
64
65 QCommandLineOption includeSystemScopes("include-system-scopes",
65 QCommandLineOption includeSystemScopes("include-system-scopes",
@@ -70,7 +70,11 @@ int main(int argc, char *argv[])
70 parser.addOption(includeServerScopes);
70 parser.addOption(includeServerScopes);
71 parser.addOption(includeSystemScopes);
71 parser.addOption(includeSystemScopes);
72
72
73− parser.process(*application);
73+ parser.parse(application->arguments());
74+
75+ if (parser.isSet(helpOption)) {
76+ parser.showHelp();
77+ }
74
78
75 QStringList extraScopes = parser.positionalArguments();
79 QStringList extraScopes = parser.positionalArguments();
76
80