Message405509
The code below, when invoked with -h, prints:
(.env) [andrew@localhost py]$ python -m tests_sa.argparse_bug -h
usage: argparse_bug.py [-h] (-a A | [-b B | -c C)]
options:
-h, --help show this help message and exit
-a A
-b B
-c C
where the final two characters in the usage line are swapped. It should be
usage: argparse_bug.py [-h] (-a A | [-b B | -c C])
or maybe even
usage: argparse_bug.py [-h] (-a A | (-b B | -c C))
from argparse import ArgumentParser
def main():
parser = ArgumentParser()
outer = parser.add_mutually_exclusive_group(required=True)
outer.add_argument('-a')
inner = outer.add_mutually_exclusive_group()
inner.add_argument('-b')
inner.add_argument('-c')
parser.parse_args()
if __name__ == '__main__':
main() |
|
Date |
User |
Action |
Args |
2021-11-02 13:39:20 | acooke | set | recipients:
+ acooke |
2021-11-02 13:39:20 | acooke | set | messageid: <1635860360.92.0.910770346728.issue45690@roundup.psfhosted.org> |
2021-11-02 13:39:20 | acooke | link | issue45690 messages |
2021-11-02 13:39:20 | acooke | create | |
|