Message299609
argparse roughly follows POSIX practice:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html
Guideline 10:
The first -- argument that is not an option-argument should be
accepted as a delimiter indicating the end of options. Any
following arguments should be treated as operands, even if they
begin with the '-' character.
I don't think this kind of thing is fixed, but there should be good reason to make an enhancement. For many users argparse is already too complicated, and the docs are hard to understand. Yet another parameter can get lost.
There are some known problems with this '--', specially when there are more than one. It may also have problems when used with subparers, though I forget the details.
It wouldn't hard to substitute a CONST variable for this '--', and wouldn't require changes to the API.
Another possibility is to change this '--' to 'parser.prefix_chars[0]*2'. Documenting that would be more work than implementing it. And we'd have to add a unittest case. |
|
Date |
User |
Action |
Args |
2017-08-01 07:13:10 | paul.j3 | set | recipients:
+ paul.j3, steven.daprano, Leon Avery |
2017-08-01 07:13:10 | paul.j3 | set | messageid: <1501571590.3.0.367837354312.issue31012@psf.upfronthosting.co.za> |
2017-08-01 07:13:10 | paul.j3 | link | issue31012 messages |
2017-08-01 07:13:09 | paul.j3 | create | |
|