how to let the parser print help message rather than error and exit
- by fluter
Hi, I am using argparse to handle cmd args, I wanna if there is no args specified, then print the help message, but now the parse will output a error, and then exit.
my code is:
def main():
print "in abing/start/main"
parser = argparse.ArgumentParser(prog="abing")#, usage="%(prog)s <command> [args] [--help]")
…