This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mendelmaleh
Recipients mendelmaleh, paul.j3, python-dev, rhettinger, shihai1991
Date 2020-11-11.16:49:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605113400.04.0.159609119509.issue42258@roundup.psfhosted.org>
In-reply-to
Content
When using more than one flag for an argument, it is redundant to have the choices more than once, since they are the same argument and have the same choices.
Showing it once means cleaner output, and often means that the other option lines are shorter, like in the test case.

### sample code
```py
import argparse

ap = argparse.ArgumentParser(allow_abbrev=False)
ap.add_argument('-c', '--choices', choices=['a', 'b', 'c'])
ap.parse_args()
```

### previous output
```
usage: main.py [-h] [-c {a,b,c}]

optional arguments:
  -h, --help            show this help message and exit
  -c {a,b,c}, --choices {a,b,c}
```

### new output
```
usage: main.py [-h] [-c {a,b,c}]

optional arguments:
  -h, --help            show this help message and exit
  -c, --choices {a,b,c}
```
History
Date User Action Args
2020-11-11 16:50:00mendelmalehsetrecipients: + mendelmaleh, rhettinger, python-dev, paul.j3, shihai1991
2020-11-11 16:50:00mendelmalehsetmessageid: <1605113400.04.0.159609119509.issue42258@roundup.psfhosted.org>
2020-11-11 16:50:00mendelmalehlinkissue42258 messages
2020-11-11 16:49:59mendelmalehcreate