Do error-handling ourselves in argument parsing.

This means we only print a warning on unhandled options instead of
exiting the application.
This commit is contained in:
Rasmus Karlsson 2020-10-18 22:56:54 +02:00
parent 72f44ccdc3
commit acec41685e

View file

@ -30,7 +30,18 @@ Args::Args(const QApplication &app)
"specify platform. Only twitch channels are supported at the moment.\n" "specify platform. Only twitch channels are supported at the moment.\n"
"If platform isn't specified, default is Twitch.", "If platform isn't specified, default is Twitch.",
"t:channel1;t:channel2;...")); "t:channel1;t:channel2;..."));
parser.process(app);
if (!parser.parse(app.arguments()))
{
qDebug() << "Warning: Unhandled options:"
<< parser.unknownOptionNames();
}
if (parser.isSet("help"))
{
qDebug().noquote() << parser.helpText();
::exit(EXIT_SUCCESS);
}
const QStringList args = parser.positionalArguments(); const QStringList args = parser.positionalArguments();
this->shouldRunBrowserExtensionHost = this->shouldRunBrowserExtensionHost =