mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
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:
parent
72f44ccdc3
commit
acec41685e
1 changed files with 12 additions and 1 deletions
|
@ -30,7 +30,18 @@ Args::Args(const QApplication &app)
|
|||
"specify platform. Only twitch channels are supported at the moment.\n"
|
||||
"If platform isn't specified, default is Twitch.",
|
||||
"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();
|
||||
this->shouldRunBrowserExtensionHost =
|
||||
|
|
Loading…
Reference in a new issue