problem with boolean option

This commit is contained in:
2019-07-30 08:48:46 +02:00
parent e2c4e3381a
commit 504d5d71a4
2 changed files with 13 additions and 11 deletions

View File

@ -147,13 +147,15 @@ class _BuildKwargs:
cmdlineparser: 'TiramisuCmdlineParser',
properties: List[str],
force_no: bool,
force_del: bool) -> None:
force_del: bool,
display_modified_value: bool,
not_display: bool) -> None:
self.kwargs = {}
self.cmdlineparser = cmdlineparser
self.properties = properties
self.force_no = force_no
self.force_del = force_del
if not self.force_no and not self.force_del:
if (not self.force_no or (not_display and not display_modified_value)) and not self.force_del:
description = option.doc()
if not description:
description = description.replace('%', '%%')
@ -404,8 +406,9 @@ class TiramisuCmdlineParser(ArgumentParser):
properties = obj.option.properties()
else:
properties = obj.property.get()
kwargs = _BuildKwargs(name, option, self, properties, force_no, force_del)
if not option.isfollower() and _forhelp and not obj.owner.isdefault() and value is not None and not force_no:
not_display = not option.isfollower() and not obj.owner.isdefault() and value is not None
kwargs = _BuildKwargs(name, option, self, properties, force_no, force_del, self.display_modified_value, not_display)
if _forhelp and not_display and ((value is not False and not force_no) or (value is False and force_no)):
options_is_not_default[option.name()] = {'properties': properties,
'type': option.type(),
'name': name,