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 martin.panter
Recipients Max Rothman, martin.panter, paul.j3, r.david.murray
Date 2017-03-13.10:42:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489401739.68.0.880454224122.issue29715@psf.upfronthosting.co.za>
In-reply-to
Content
Max, I’m not sure if you saw the double-dash (--) workaround. IMO that is the “correct” way to do this for Unix command lines, and for the current version of “argparse”. But I guess that may be too inconvenient for your Morse Code case. Perhaps you can write your own custom sys.argv parser, or find some other argument handling library out there that doesn’t follow the usual Unix conventions.

I don’t really like the proposal from Issue 9334 (classifying CLI arguments based on registered options). It seems hard to predict and specify (too complex) for only a minor use case. Although it does fix part of the other problem with option arguments, it is not a general solution.

Assuming “-h” and “--help” are registered by default, how would an invocation like “prog.py -hi” be treated under the proposal (currently an error because -h does not accept an argument)? What about “prog.py -help”? What about “prog.py --h”, currently treated as an abbreviation of “--help”?
History
Date User Action Args
2017-03-13 10:42:19martin.pantersetrecipients: + martin.panter, r.david.murray, paul.j3, Max Rothman
2017-03-13 10:42:19martin.pantersetmessageid: <1489401739.68.0.880454224122.issue29715@psf.upfronthosting.co.za>
2017-03-13 10:42:19martin.panterlinkissue29715 messages
2017-03-13 10:42:19martin.pantercreate