[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)
Martin Panter
report at bugs.python.org
Mon Apr 11 21:25:00 EDT 2016
Martin Panter added the comment:
My main concern with the patch is that it only half fixes the problem. It sounds like it will allow parsing “--opt -x” (if “-x” is not registered as an option), but will still refuse “--opt -h”, assuming “-h” is registered by default. What is the barrier to parsing an argument to the option syntax independently of what option names are registered?
Also the name “args_default_to_positional=True” name is both unwieldy and vague to me. The purpose seems to be to disable option-lookalike-strings from being reserved. Maybe call it something like “reserve_all_options=False” or “reserve_unregistered_options=False”?
I left some thoughts in the code review for the documentation too.
----------
nosy: +martin.panter
stage: needs patch -> patch review
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9334>
_______________________________________
More information about the Python-bugs-list
mailing list