Message219264
Yes, I have a practical need for dest=SUPPRESS. One of the reasons is basically what you said: to implement things analogous to --help. In those cases you want to be able to invoke a function (e.g. via type=myfunc) but not store anything. Or you may need to ignore an argument completely for compatibility, but you have logic which expects all the arguments returned by parse_args() to be known and meaningful. In any case, I wrote this ticket because I ran into a concrete need that argparse didn't readily support (which almost never happens!).
As for what the usage statement should show: it should behave as if dest=SUPPRESS were not present. If metavar is specified, use that, otherwise use the option name as if dest were not passed in. And we already have the behavior that help=SUPPRESS will hide it from the usage entirely, so that should still work (i.e. dest=SUPPRESS, help=SUPPRESS should hide the option both from --help and the result of parse_args()). |
|
Date |
User |
Action |
Args |
2014-05-28 11:34:05 | jzwinck | set | recipients:
+ jzwinck, paul.j3 |
2014-05-28 11:34:05 | jzwinck | set | messageid: <1401276845.33.0.375796393396.issue20430@psf.upfronthosting.co.za> |
2014-05-28 11:34:05 | jzwinck | link | issue20430 messages |
2014-05-28 11:34:02 | jzwinck | create | |
|