1
0
Fork 0

src/Main/options.cxx: allow bool options to be disabled if set to 0 or false.

E.g. --disable-splash-screen=0 will not disable the splash screen.
This commit is contained in:
Julian Smith 2021-12-03 23:34:14 +00:00
parent 77c362a9d4
commit b0f0700b19

View file

@ -2085,7 +2085,12 @@ public:
switch ( desc->type & 0xffff ) { switch ( desc->type & 0xffff ) {
case OPTION_BOOL: case OPTION_BOOL:
if (arg_value == "0" || arg_value == "false") {
SG_LOG( SG_GENERAL, SG_ALERT, "Ignoring bool option '" << desc->option << "' because value is " << arg_value);
}
else {
fgSetBool( desc->property, desc->b_param ); fgSetBool( desc->property, desc->b_param );
}
break; break;
case OPTION_STRING: case OPTION_STRING:
if ( desc->has_param && !arg_value.empty() ) { if ( desc->has_param && !arg_value.empty() ) {