Home > other >  How to use the argparse replacement in python built-in '-h' action?
How to use the argparse replacement in python built-in '-h' action?

Time:11-21

I create a command-line tool in python, I'm using argparse to resolve my input.
I want to use the "-h" as the action, but it is automatically assigned to - help. How to cover it with -h action?

CodePudding user response:


Parser=argparse. ArgumentParser (add_help=False)

Thank you for your enquiry, because a few days ago I met the same problem, now only bothered to check the documentation.

CodePudding user response:

It may not be able to use -- help either
  • Related