[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

Eric V. Smith report at bugs.python.org
Tue Jan 9 04:08:13 EST 2018


Eric V. Smith <eric at trueblade.com> added the comment:

I tend to agree with you about pre-scanning the arguments to find options. But at this point, our options to change the code are limited. The last time I looked at this (and it's been years), I came to the conclusion that the argument pre-scanning was sufficiently baked in to argparse that a separate traditional" mode was better done as a separate library.

But I lack the time and energy to research if there's an existing third party library that's acceptable, what it would take to enhance optparse, or write a new library.

It sounds like what you want is optparse, but with help in processing positional arguments. Is that a fair statement? Or is there some other feature of argparse that's preventing you from using optparse? I know for me it's help with positional arguments.

I think at some point we need to close this bug, because I don't see a way of modifying argparse to do what you (and I) want. paul.j3 explains several times in his messages on this thread that it's just how argparse fundamentally works.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue9334>
_______________________________________


More information about the Python-bugs-list mailing list