Merge "genconfig: Debug info for unknown config types"
This commit is contained in:
commit
792faff750
@ -268,11 +268,12 @@ def _print_opt(opt, group):
|
|||||||
if not opt_help:
|
if not opt_help:
|
||||||
sys.stderr.write('WARNING: "%s" is missing help string.\n' % opt_name)
|
sys.stderr.write('WARNING: "%s" is missing help string.\n' % opt_name)
|
||||||
opt_help = ""
|
opt_help = ""
|
||||||
try:
|
result = OPTION_REGEX.search(str(type(opt)))
|
||||||
opt_type = OPTION_REGEX.search(str(type(opt))).group(0)
|
if not result:
|
||||||
except (ValueError, AttributeError) as err:
|
raise ValueError(
|
||||||
sys.stderr.write("%s\n" % err)
|
"Config option: {!r} Unknown option type: {}\n".format(
|
||||||
sys.exit(1)
|
opt_name, type(opt)))
|
||||||
|
opt_type = result.group(0)
|
||||||
opt_help = u'%s (%s)' % (opt_help,
|
opt_help = u'%s (%s)' % (opt_help,
|
||||||
OPT_TYPES[opt_type])
|
OPT_TYPES[opt_type])
|
||||||
print('#', "\n# ".join(textwrap.wrap(opt_help, WORDWRAP_WIDTH)))
|
print('#', "\n# ".join(textwrap.wrap(opt_help, WORDWRAP_WIDTH)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user