Skip to content

Instantly share code, notes, and snippets.

@mwcraig
Created September 24, 2013 14:34
Show Gist options
  • Save mwcraig/6685685 to your computer and use it in GitHub Desktop.
Save mwcraig/6685685 to your computer and use it in GitHub Desktop.
Files for sphinx-argparse bug

Notice there is no visual difference between single dash - and double-dash --, and the -h option isn't listed under options.

.. argparse::
    :module: parser_bug
    :func: construct_parser
    :prog: python parser_bug.py
def construct_parser():
import argparse
parser = argparse.ArgumentParser()
parser.formatter_class = argparse.RawDescriptionHelpFormatter
parser.add_argument('-v', '--verbose', help="More information while running",
action='store_true')
return parser
if __name__ == '__main__':
parser = construct_parser()
parser.parse_args()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment