Passing skip_unknown_args=True to the parser only ever showed the
usage message.
The problem is that parser.parse_known_args()
(ArgumentParser.parse_known_args) returns a tuple
(namespace, remainder) instead of just a namespace object like
parser.parse_args. Once you pass this to
_get_function_from_namespace_obj it gets confused.
The unit test was expecting to only ever show the usage message when
skipping unknown args.
The remaining unknown args are stored on the namespace as _unkown_args,
so it's at least accessible (if we use @expects_obj)
Coverage decreased (-0.2%) to 93.131% when pulling 33c25351c064b70b69f1a90583eb3da7b32d7cd9 on CruxConnect:master into dcd3253f2994400a6a58a700c118c53765bc50a4 on neithere:master.
Coverage decreased (-0.2%) to 93.131% when pulling 33c25351c064b70b69f1a90583eb3da7b32d7cd9 on CruxConnect:master into dcd3253f2994400a6a58a700c118c53765bc50a4 on neithere:master.
Passing
skip_unknown_args=True
to the parser only ever showed the usage message.The problem is that
parser.parse_known_args()
(ArgumentParser.parse_known_args
) returns a tuple(namespace, remainder)
instead of just a namespace object likeparser.parse_args
. Once you pass this to_get_function_from_namespace_obj
it gets confused.The unit test was expecting to only ever show the usage message when skipping unknown args.
The remaining unknown args are stored on the namespace as
_unkown_args
, so it's at least accessible (if we use@expects_obj
)This uses and supersedes #86