How can I replace the built-in action "-h" in python with argparse?

I am building a command line tool in python and I am using argparse to parse my input.

I want to use "-h" as an action, but this is already automatically assigned to -help. How can I override this and perform the -h action?


source to share

1 answer

parser = argparse.ArgumentParser(add_help=False)


Thanks for asking because I had the same problem the other day and was just now worried about checking the documentation .



All Articles