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:
parent
f8d792e82d
commit
0ddb883451
2 changed files with 10 additions and 1 deletions
|
@ -320,10 +320,18 @@ bool fgInitFGAircraft ( int argc, char **argv ) {
|
||||||
// First parse command line options looking for --aircraft=, this
|
// First parse command line options looking for --aircraft=, this
|
||||||
// will override anything specified in a config file
|
// will override anything specified in a config file
|
||||||
aircraft = fgScanForOption( "--aircraft=", argc, argv );
|
aircraft = fgScanForOption( "--aircraft=", argc, argv );
|
||||||
|
if ( aircraft.empty() ) {
|
||||||
|
// check synonym option
|
||||||
|
aircraft = fgScanForOption( "--vehicle=", argc, argv );
|
||||||
|
}
|
||||||
|
|
||||||
// Check in one of the user configuration files.
|
// Check in one of the user configuration files.
|
||||||
if ( aircraft.empty() )
|
if ( aircraft.empty() ) {
|
||||||
aircraft = fgScanForOption( "--aircraft=" );
|
aircraft = fgScanForOption( "--aircraft=" );
|
||||||
|
}
|
||||||
|
if ( aircraft.empty() ) {
|
||||||
|
aircraft = fgScanForOption( "--vehicle=" );
|
||||||
|
}
|
||||||
|
|
||||||
// if an aircraft was specified, set the property name
|
// if an aircraft was specified, set the property name
|
||||||
if ( !aircraft.empty() ) {
|
if ( !aircraft.empty() ) {
|
||||||
|
|
|
@ -1384,6 +1384,7 @@ struct OptionDesc {
|
||||||
{"flight-plan", true, OPTION_FUNC, "", false, "", fgOptFlightPlan },
|
{"flight-plan", true, OPTION_FUNC, "", false, "", fgOptFlightPlan },
|
||||||
{"config", true, OPTION_FUNC, "", false, "", fgOptConfig },
|
{"config", true, OPTION_FUNC, "", false, "", fgOptConfig },
|
||||||
{"aircraft", true, OPTION_STRING, "/sim/aircraft", false, "", 0 },
|
{"aircraft", true, OPTION_STRING, "/sim/aircraft", false, "", 0 },
|
||||||
|
{"vehicle", true, OPTION_STRING, "/sim/aircraft", false, "", 0 },
|
||||||
{"failure", true, OPTION_FUNC, "", false, "", fgOptFailure },
|
{"failure", true, OPTION_FUNC, "", false, "", fgOptFailure },
|
||||||
{"com1", true, OPTION_DOUBLE, "/instrumentation/comm[0]/frequencies/selected-mhz", false, "", 0 },
|
{"com1", true, OPTION_DOUBLE, "/instrumentation/comm[0]/frequencies/selected-mhz", false, "", 0 },
|
||||||
{"com2", true, OPTION_DOUBLE, "/instrumentation/comm[1]/frequencies/selected-mhz", false, "", 0 },
|
{"com2", true, OPTION_DOUBLE, "/instrumentation/comm[1]/frequencies/selected-mhz", false, "", 0 },
|
||||||
|
|
Loading…
Add table
Reference in a new issue