Print program usage example with argparse module
I am trying to learn how to use python's argparse module. Currently my python script is: parser = argparse.ArgumentParser(description='My first argparse attempt', add_help=True) parser.add_argument("-q", action ="store", dest='argument', help="First argument") output = parser.parse_args() And it gives the output as : usage: test.py [-h] [-q ARGUMENT] My first argparse attempt optional arguments: -h, --help show this help message and exit -q ARGUMENT First argument Now, lets suppose I want my -h or --help argument to print a usage example also. Like, Usage: python test.py -q "First Argument for