Last active
January 27, 2016 09:28
-
-
Save tonygaetani/e3a36f1cbfd23559c25c to your computer and use it in GitHub Desktop.
Potential argparse issue?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# mac OSX 10.10.3 | |
# python 2.7.10 (installed with homebrew) | |
# argparse 1.4.0 | |
# to test - `python argparseissue.py --help` | |
# expected - | |
# usage: issue.py [-h] -f FOO [-b BAR] | |
# | |
# This is an attempt to replicate an issue with argparse | |
# | |
# required arguments: | |
# -f FOO, --foo FOO this argument is REQUIRED!!! | |
# optional arguments: | |
# -h, --help show this help message and exit | |
# -b BAR, --bar BAR this argument is optional | |
# | |
# I hope somebody fixes it! | |
# actual - | |
# usage: issue.py [-h] -f FOO [-b BAR] | |
# | |
# This is an attempt to replicate an issue with argparse | |
# | |
# optional arguments: | |
# -h, --help show this help message and exit | |
# -f FOO, --foo FOO this argument is REQUIRED!!! | |
# -b BAR, --bar BAR this argument is optional | |
# | |
# I hope somebody fixes it! | |
from argparse import ArgumentParser | |
parser = ArgumentParser(description='This is an attempt to replicate an issue with argparse', | |
epilog='I hope somebody fixes it!') | |
parser.add_argument('-f', '--foo', required=True, help='this argument is REQUIRED!!!') | |
parser.add_argument('-b', '--bar', help='this argument is optional') | |
parser.parse_args() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://bugs.python.org/issue9694