Martin Panter added the comment:

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”?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29715>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to