Report bad command-line args via message box.
This makes the behaviour when FGRun (or other GUI launchers) send bad options much more explicable. Non Windows/Mac systems get an SG_ALERT on the console as before.
This commit is contained in:
parent
64cbc06003
commit
c8b1655edc
1 changed files with 3 additions and 3 deletions
|
@ -2048,7 +2048,7 @@ int Options::parseOption(const string& s)
|
|||
|
||||
return addOption(key, value);
|
||||
} else {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "unknown option:" << s);
|
||||
flightgear::modalMessageBox("Unknown option", "Unknown command-line option: " + s);
|
||||
return FG_OPTIONS_ERROR;
|
||||
}
|
||||
}
|
||||
|
@ -2057,14 +2057,14 @@ int Options::addOption(const string &key, const string &value)
|
|||
{
|
||||
OptionDesc* desc = p->findOption(key);
|
||||
if (!desc) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "unknown option:" << key);
|
||||
flightgear::modalMessageBox("Unknown option", "Unknown command-line option: " + key);
|
||||
return FG_OPTIONS_ERROR;
|
||||
}
|
||||
|
||||
if (!(desc->type & OPTION_MULTI)) {
|
||||
OptionValueVec::const_iterator it = p->findValue(key);
|
||||
if (it != p->values.end()) {
|
||||
SG_LOG(SG_GENERAL, SG_INFO, "multiple values forbidden for option:" << key << ", ignoring:" << value);
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "multiple values forbidden for option:" << key << ", ignoring:" << value);
|
||||
return FG_OPTIONS_OK;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue