Commit 3a7ad05f authored by Martin Craig's avatar Martin Craig
Browse files

Arguments given as None are ignored

It's often helpful to be able to leave an argument as None and only set it
if you want to use it.
parent 9eb11443
......@@ -299,11 +299,12 @@ def applyArgStyle(style, valsep=None, argmap=None, valmap=None, singlechar_args=
for k, v in kwargs.items():
if v is None: continue
k = argmap.get(k, k)
mapv = valmap.get(k, fmtval(v))
k = fmtarg(k)
if mapv in (SHOW_IF_TRUE, HIDE_IF_TRUE):
if (mapv is SHOW_IF_TRUE and v) or \
(mapv is HIDE_IF_TRUE and not v):
......@@ -621,6 +622,7 @@ class _FileOrThing(object):
val = allargs.get(name, None)
if val is None:
allargs.pop(name, None)
if val is LOAD:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment