Fixed #340: help and version should be command line output
This commit is contained in:
parent
10fc2918ef
commit
9b1c692d76
6
main.cpp
6
main.cpp
@ -137,19 +137,19 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!parser.parse (a.arguments ()))
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (parser.isSet (help_option))
|
if (parser.isSet (help_option))
|
||||||
{
|
{
|
||||||
MessageBox::information_message (nullptr, a.translate ("main", "Command line help"), parser.helpText ());
|
parser.showHelp (-1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (parser.isSet (version_option))
|
else if (parser.isSet (version_option))
|
||||||
{
|
{
|
||||||
MessageBox::information_message (nullptr, a.translate ("main", "Application version"), a.applicationVersion ());
|
parser.showVersion();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user