]> git.mxchange.org Git - flightgear.git/commitdiff
Add a --vehicle= option which is a synonym for --aircraft= but is more
authorcurt <curt>
Fri, 2 Nov 2007 18:39:10 +0000 (18:39 +0000)
committercurt <curt>
Fri, 2 Nov 2007 18:39:10 +0000 (18:39 +0000)
natural when selecting ground vehicles like a jeep or a snowplow.

src/Main/fg_init.cxx
src/Main/options.cxx

index e1aba14ee44591377b5bc6b8b3cf78a670c80b52..fc2fc7ec67be29d5ee96fc2ae5607b7281fc33ae 100644 (file)
@@ -320,10 +320,18 @@ bool fgInitFGAircraft ( int argc, char **argv ) {
     // First parse command line options looking for --aircraft=, this
     // will override anything specified in a config file
     aircraft = fgScanForOption( "--aircraft=", argc, argv );
+    if ( aircraft.empty() ) {
+        // check synonym option
+        aircraft = fgScanForOption( "--vehicle=", argc, argv );
+    }
 
     // Check in one of the user configuration files.
-    if ( aircraft.empty() )
+    if ( aircraft.empty() ) {
         aircraft = fgScanForOption( "--aircraft=" );
+    }
+    if ( aircraft.empty() ) {
+        aircraft = fgScanForOption( "--vehicle=" );
+    }
 
     // if an aircraft was specified, set the property name
     if ( !aircraft.empty() ) {
index f2d2ba286d3792f7cf85bfe2a6f0d8f7d0eeea98..73af0ebc508c81823a040f86ed801a50f6569824 100644 (file)
@@ -1384,6 +1384,7 @@ struct OptionDesc {
     {"flight-plan",                  true,  OPTION_FUNC,   "", false, "", fgOptFlightPlan },
     {"config",                       true,  OPTION_FUNC,   "", false, "", fgOptConfig },
     {"aircraft",                     true,  OPTION_STRING, "/sim/aircraft", false, "", 0 },
+    {"vehicle",                      true,  OPTION_STRING, "/sim/aircraft", false, "", 0 },
     {"failure",                      true,  OPTION_FUNC,   "", false, "", fgOptFailure },
     {"com1",                         true,  OPTION_DOUBLE, "/instrumentation/comm[0]/frequencies/selected-mhz", false, "", 0 },
     {"com2",                         true,  OPTION_DOUBLE, "/instrumentation/comm[1]/frequencies/selected-mhz", false, "", 0 },