Fixed #340: help and version should be command line output

This commit is contained in:
Jordan Sherer 2020-06-05 10:33:56 -04:00
parent 10fc2918ef
commit 9b1c692d76

View File

@ -137,19 +137,19 @@ int main(int argc, char *argv[])
if (!parser.parse (a.arguments ()))
{
MessageBox::critical_message (nullptr, a.translate ("main", "Command line error"), parser.errorText ());
std::cerr << parser.errorText().toLocal8Bit ().data () << std::endl;
return -1;
}
else
{
if (parser.isSet (help_option))
{
MessageBox::information_message (nullptr, a.translate ("main", "Command line help"), parser.helpText ());
parser.showHelp (-1);
return 0;
}
else if (parser.isSet (version_option))
{
MessageBox::information_message (nullptr, a.translate ("main", "Application version"), a.applicationVersion ());
parser.showVersion();
return 0;
}
}