From c8b1655edc78e5f937e7f85795e565e27754b94d Mon Sep 17 00:00:00 2001 From: James Turner Date: Sat, 25 Jan 2014 10:36:00 +0000 Subject: [PATCH] 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. --- src/Main/options.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 3c20cdee8..7448eb6ed 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -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; } }