]> git.mxchange.org Git - flightgear.git/commitdiff
Report bad command-line args via message box.
authorJames Turner <zakalawe@mac.com>
Sat, 25 Jan 2014 10:36:00 +0000 (10:36 +0000)
committerJames Turner <zakalawe@mac.com>
Sat, 25 Jan 2014 10:36:00 +0000 (10:36 +0000)
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

index 3c20cdee8a8154d97cdeab7822e9feaa46bf50eb..7448eb6ed46330851b319e31a28df6e9f0d54529 100644 (file)
@@ -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;
     }
   }