on xenial help sign in
unity-scope-tool: Use parse instead of process

This way we can pass --desktop_file_hint on the phone Approved by: Michael Terry

commitba04cc972903d2f681fdbcfb4cc2c520623a9130 authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 3 Aug 2016, 15:50 (10 years ago) parenteb2005081c4c88
1 file changed+6−2
tools/scopetool.cpp+6−2
tools/scopetool.cpp+6−2
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
5959 "Otherwise passing a path to a scope config file will open a session with\n"
6060 "only that scope (assuming that the binary implementing the scope can be\n"
6161 "found in the same directory as the config file).");
62− parser.addHelpOption();
62+ QCommandLineOption helpOption = parser.addHelpOption();
6363 parser.addPositionalArgument("scopes", "Paths to scope config files to spawn, optionally.", "[scopes...]");
6464
6565 QCommandLineOption includeSystemScopes("include-system-scopes",
@@ -70,7 +70,11 @@ int main(int argc, char *argv[])
7070 parser.addOption(includeServerScopes);
7171 parser.addOption(includeSystemScopes);
7272
73− parser.process(*application);
73+ parser.parse(application->arguments());
74+
75+ if (parser.isSet(helpOption)) {
76+ parser.showHelp();
77+ }
7478
7579 QStringList extraScopes = parser.positionalArguments();
7680