This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients Max Rothman, martin.panter, paul.j3, r.david.murray
Date 2017-03-13.04:11:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489378275.92.0.436711160823.issue29715@psf.upfronthosting.co.za>
In-reply-to
Content
http://bugs.python.org/issue9334, 'argparse does not accept options taking arguments beginning with dash (regression from optparse)'

is an old discussion about strings that begin with a dash and don't 
match defined flags.

One proposal was to add a 'args_default_to_positional' parameter, and change the parsing that I described before to:

+        # behave more like optparse even if the argument looks like a option
+        if self.args_default_to_positional:
+            return None
         # instead of return None, arg_string, None

There's a long discussion but nothing was changed (not even the test for negative numbers).

Two work arounds still apply

    prog.py -- -_       # use -- to signal positional values
    prog.py --first=-_  # = to attach any string to optional


(in my previous post I cited 'Bernard', I meant the module's original author, Steven Bethard.  He's no longer actively involved in these bug/issues.)
History
Date User Action Args
2017-03-13 04:11:15paul.j3setrecipients: + paul.j3, r.david.murray, martin.panter, Max Rothman
2017-03-13 04:11:15paul.j3setmessageid: <1489378275.92.0.436711160823.issue29715@psf.upfronthosting.co.za>
2017-03-13 04:11:15paul.j3linkissue29715 messages
2017-03-13 04:11:15paul.j3create