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
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() |