on xenial help sign in
Make parser treat single dash argumens the same as double dash arguments
commit358de217a782e92eb5cb4e2cf36d891c2ca8e13c authorJosh Arenson <joshua.arenson@canonical.com> dateMon 21 Apr 2014, 16:57 (12 years ago) parent50572ad
2 files changed+6−3
run+2−2 src/main.cpp+4−1
run+2−2
@@ -19,7 +19,7 @@ usage() {
1919 echo " -k, --keylock Use a passphrase protected user." >&2
2020 echo " -g, --gdb Run through gdb." >&2
2121 echo " -h, --help Show this help." >&2
22− echo " -m, --nomousetouch Run without -mousetouch argument." >&2
22+ echo " -m, --nomousetouch Run without --mousetouch argument." >&2
2323 echo >&2
2424 exit 1
2525}
@@ -65,7 +65,7 @@ fi
6565
6666QML_PHONE_SHELL_ARGS=""
6767if $MOUSE_TOUCH; then
68− QML_PHONE_SHELL_ARGS="$QML_PHONE_SHELL_ARGS -mousetouch"
68+ QML_PHONE_SHELL_ARGS="$QML_PHONE_SHELL_ARGS --mousetouch"
6969fi
7070
7171control_c()
src/main.cpp+4−1
@@ -81,7 +81,10 @@ QT_LOAD_TESTABILITY instead. \nLoad the testability driver"));
8181 } else {
8282 application = new QGuiApplication(argc, (char**)argv);
8383 }
84−
84+
85+ // Treat args with single dashes the same as arguments with two dashes
86+ // Ex: -fullscreen == --fullscreen
87+ parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
8588 parser.process(*application);
8689
8790 QString indicatorProfile = qgetenv("UNITY_INDICATOR_PROFILE");