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

Steven Bethard report at bugs.python.org
Sun Feb 6 10:47:38 CET 2011


Steven Bethard <steven.bethard at gmail.com> added the comment:

Yeah, I agree it's not ideal, though note that basic unix commands have trouble with arguments staring with dashes:

$ cd -links-/
-bash: cd: -l: invalid option
cd: usage: cd [-L|-P] [dir]

If you're working with a file on a filesystem, the time honored workaround is to prefix with ./

$ cd ./-links-/
$

Anyway, it doesn't seem like anyone is offering to write up a patch to enable such an alternative parsing strategy, perhaps Eric's "=" workaround should be documented prominently somewhere?

----------

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


More information about the Python-bugs-list mailing list