1
0
Fork 0

Add a --vehicle= option which is a synonym for --aircraft= but is more

natural when selecting ground vehicles like a jeep or a snowplow.
This commit is contained in:
curt 2007-11-02 18:39:10 +00:00
parent f8d792e82d
commit 0ddb883451
2 changed files with 10 additions and 1 deletions

View 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() ) {

View 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 },