Message156276
> It prevents implementing parsers that pass strings on to another
> sub-parser or command.
...
> wouldn't you use 'parse_known_args' instead of 'parse_args'
> and pass the remaining arguments to the next script
I'll just say again that the recommended way of passing arguments to another command is via nargs=argparse.REMAINDER. (Though you may still need "--" if the first argument in the remainder is a flag shared by your parser, as Warren Turka pointed out.)
> I really want "--" to mean "treat everything else as non-optional
> arguments"
Yep, and that's what it's intended to mean, and what the documentation says:
"you can insert the pseudo-argument '--' which tells parse_args() that everything after that is a positional argument"
http://docs.python.org/library/argparse.html#arguments-containing
It's therefore a bug if there's a '--' after the first '--', but it's not being treated as a positional argument. |
|
Date |
User |
Action |
Args |
2012-03-18 21:41:40 | bethard | set | recipients:
+ bethard, eric.smith, kalt, r.david.murray, wt, jeffknupp |
2012-03-18 21:41:39 | bethard | set | messageid: <1332106899.97.0.563731511313.issue13922@psf.upfronthosting.co.za> |
2012-03-18 21:41:39 | bethard | link | issue13922 messages |
2012-03-18 21:41:39 | bethard | create | |
|