@@ -195,49 +220,54 @@
return hasControllingTTY;
}
-void fillCommandLineOptions(KCmdLineOptions& options)
-{
- options.add("profile <name>",
- ki18nc("@info:shell", "Name of profile to use for new Konsole instance"));
- options.add("fallback-profile",
- ki18nc("@info:shell", "Use the internal FALLBACK profile"));
- options.add("workdir <dir>",
- ki18nc("@info:shell", "Set the initial working directory of the new tab or"
- " window to 'dir'"));
- options.add("hold");
- options.add("noclose",
- ki18nc("@info:shell", "Do not close the initial session automatically when it"
- " ends."));
- options.add("new-tab",
- ki18nc("@info:shell", "Create a new tab in an existing window rather than"
- " creating a new window"));
- options.add("tabs-from-file <file>",
- ki18nc("@info:shell", "Create tabs as specified in given tabs configuration"
- " file"));
- options.add("background-mode",
- ki18nc("@info:shell", "Start Konsole in the background and bring to the front"
- " when Ctrl+Shift+F12 (by default) is pressed"));
- options.add("separate", ki18n("Run in a separate process"));
- options.add("show-menubar", ki18nc("@info:shell", "Show the menubar, overriding the default setting"));
- options.add("hide-menubar", ki18nc("@info:shell", "Hide the menubar, overriding the default setting"));
- options.add("show-tabbar", ki18nc("@info:shell", "Show the tabbar, overriding the default setting"));
- options.add("hide-tabbar", ki18nc("@info:shell", "Hide the tabbar, overriding the default setting"));
- options.add("fullscreen", ki18nc("@info:shell", "Start Konsole in fullscreen mode"));
- options.add("notransparency",
- ki18nc("@info:shell", "Disable transparent backgrounds, even if the system"
- " supports them."));
- options.add("list-profiles", ki18nc("@info:shell", "List the available profiles"));
- options.add("list-profile-properties",
- ki18nc("@info:shell", "List all the profile properties names and their type"
- " (for use with -p)"));
- options.add("p <property=value>",
- ki18nc("@info:shell", "Change the value of a profile property."));
- options.add("!e <cmd>",
- ki18nc("@info:shell", "Command to execute. This option will catch all following"
- " arguments, so use it as the last option."));
- options.add("+[args]", ki18nc("@info:shell", "Arguments passed to command"));
- options.add("", ki18nc("@info:shell", "Use --nofork to run in the foreground (helpful"
- " with the -e option)."));
+void fillCommandLineOptions(QCommandLineParser &parser)
+{
+ parser.addOption(QCommandLineOption(QStringList() << "profile",
+ i18nc("@info:shell", "Name of profile to use for new Konsole instance"),
+ QStringLiteral("name")));
+ parser.addOption(QCommandLineOption(QStringList() << "fallback-profile",
+ i18nc("@info:shell", "Use the internal FALLBACK profile")));
+ parser.addOption(QCommandLineOption(QStringList() << "workdir",
+ i18nc("@info:shell", "Set the initial working directory of the new tab or"
+ " window to 'dir'"),
+ QStringLiteral("dir")));
+ parser.addOption(QCommandLineOption(QStringList() << "hold" << "noclose",
+ i18nc("@info:shell", "Do not close the initial session automatically when it"
+ " ends.")));
+ parser.addOption(QCommandLineOption(QStringList() << "new-tab",
+ i18nc("@info:shell", "Create a new tab in an existing window rather than"
+ " creating a new window")));
+ parser.addOption(QCommandLineOption(QStringList() << "tabs-from-file",
+ i18nc("@info:shell", "Create tabs as specified in given tabs configuration"
+ " file"),
+ QStringLiteral("file")));
+ parser.addOption(QCommandLineOption(QStringList() << "background-mode",
+ i18nc("@info:shell", "Start Konsole in the background and bring to the front"
+ " when Ctrl+Shift+F12 (by default) is pressed")));
+ parser.addOption(QCommandLineOption(QStringList() << "separate", i18n("Run in a separate process")));
+ parser.addOption(QCommandLineOption(QStringList() << "show-menubar", i18nc("@info:shell", "Show the menubar, overriding the default setting")));
+ parser.addOption(QCommandLineOption(QStringList() << "hide-menubar", i18nc("@info:shell", "Hide the menubar, overriding the default setting")));
+ parser.addOption(QCommandLineOption(QStringList() << "show-tabbar", i18nc("@info:shell", "Show the tabbar, overriding the default setting")));
+ parser.addOption(QCommandLineOption(QStringList() << "hide-tabbar", i18nc("@info:shell", "Hide the tabbar, overriding the default setting")));
+ parser.addOption(QCommandLineOption(QStringList() << "fullscreen", i18nc("@info:shell", "Start Konsole in fullscreen mode")));
+ parser.addOption(QCommandLineOption(QStringList() << "notransparency",
+ i18nc("@info:shell", "Disable transparent backgrounds, even if the system"
+ " supports them.")));
+ parser.addOption(QCommandLineOption(QStringList() << "list-profiles",
+ i18nc("@info:shell", "List the available profiles")));
+ parser.addOption(QCommandLineOption(QStringList() << "list-profile-properties",
+ i18nc("@info:shell", "List all the profile properties names and their type"
+ " (for use with -p)")));
+ parser.addOption(QCommandLineOption(QStringList() << "p",
+ i18nc("@info:shell", "Change the value of a profile property."),
+ QStringLiteral("property=value")));
+ parser.addOption(QCommandLineOption(QStringList() << "e",
+ i18nc("@info:shell", "Command to execute. This option will catch all following"
+ " arguments, so use it as the last option."),
+ QStringLiteral("cmd")));
+ parser.addPositionalArgument(QStringLiteral("[args]"),
+ i18nc("@info:shell", "Arguments passed to command"));
+
}