use dash instead of underscore in options as well
This commit is contained in:
parent
fb3e733596
commit
6d76cfa5aa
@ -73,7 +73,8 @@ def run():
|
|||||||
for section, values in config.INITIAL_CONFIG.items():
|
for section, values in config.INITIAL_CONFIG.items():
|
||||||
group = optparse.OptionGroup(parser, section)
|
group = optparse.OptionGroup(parser, section)
|
||||||
for option, default_value in values.items():
|
for option, default_value in values.items():
|
||||||
long_name = '--{0}-{1}'.format(section, option)
|
long_name = '--{0}-{1}'.format(
|
||||||
|
section, option.replace('_', '-'))
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
args = [long_name]
|
args = [long_name]
|
||||||
if default_value.lower() in ('true', 'false'):
|
if default_value.lower() in ('true', 'false'):
|
||||||
@ -117,7 +118,6 @@ def run():
|
|||||||
section = group.title
|
section = group.title
|
||||||
for option in group.option_list:
|
for option in group.option_list:
|
||||||
key = option.dest
|
key = option.dest
|
||||||
print(key)
|
|
||||||
config_key = key.split('_', 1)[1]
|
config_key = key.split('_', 1)[1]
|
||||||
if key:
|
if key:
|
||||||
value = getattr(options, key)
|
value = getattr(options, key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user