I have an argument called '--verbose' in the main parser.
Then I add a subparser called 'command', to which I add an argument with the same name '--verbose' (See attached script).
When I process these args, I cannot decide afterwards if the user called 'myscript --verbose command' or 'myscript command --verbose'. I always get the same Namespace object returned from parse_args.
IMHO the Namespace object should also provide informations about the source parser, to make main parser args and subparser args distinguishable. Also if I call 'myscript --verbose command --verbose', I should get both args in the resulting Namespace object. |