Fix determining beta value through configuration
This commit is contained in:
parent
ea702c0c43
commit
23292e5cad
3 changed files with 8 additions and 3 deletions
|
|
@ -126,8 +126,7 @@ def get_parsers():
|
|||
parser['beta'].add_argument(
|
||||
'-b', '--beta',
|
||||
help=('Enable beta functionality. '),
|
||||
action='store_true', dest='beta',
|
||||
default=False)
|
||||
action='store_true', dest='beta', default=None)
|
||||
|
||||
# Main subcommand parser
|
||||
parser['main'] = argparse.ArgumentParser(
|
||||
|
|
|
|||
|
|
@ -409,7 +409,12 @@ class Configuration(metaclass=Singleton):
|
|||
if option in args:
|
||||
dst_opt = self.ARG_OPTION_MAPPING[option]
|
||||
option_object = self.CONFIG_FILE_OPTIONS['GLOBAL'][dst_opt]
|
||||
if args[option] or isinstance(option_object, BooleanOption):
|
||||
# If option is in args.
|
||||
# Also if it is boolean but only if not None - this allows
|
||||
# False to override True.
|
||||
if (args[option] or
|
||||
(isinstance(option_object, BooleanOption) and
|
||||
args[option] is not None)):
|
||||
d[dst_opt] = args[option]
|
||||
return d
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue