aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcomex2016-11-15 21:56:00 -0500
committercomex2016-11-15 21:56:00 -0500
commitf5d7812eaa85555f1095c6b394bfbee1f4d35701 (patch)
tree2fbfa69e51479ecf62b061ef31b0d1b7de9861dd
parentMerge pull request #16 from yifanlu/fix-t2-bl (diff)
downloadsubstitute-f5d7812eaa85555f1095c6b394bfbee1f4d35701.tar.gz
fix bool arguments with false default
-rw-r--r--script/mconfig.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/script/mconfig.py b/script/mconfig.py
index 0030f60..39d801a 100644
--- a/script/mconfig.py
+++ b/script/mconfig.py
@@ -274,7 +274,7 @@ class Option(object):
if not self.show:
# If you didn't mention the option in help, you don't get no stinking value. This is for ignored options only.
return
- if value is (False if self.bool else None):
+ if value is None:
value = self.default
if callable(value): # Pending
value = value()
@@ -388,11 +388,13 @@ def _make_argparse(include_unused, include_env):
action='store_true' if opt.bool else 'store',
dest=opt.name[2:],
help=opt.help,
+ default=None,
**kw)
if opt.bool and include_unused:
ag.add_argument(opt.opposite,
action='store_false',
dest=opt.name[2:],
+ default=None,
**kw)
return parser