Open jossef opened 4 years ago
That would be great. I realized that this was not a very good design choice. However this was already implemented this way.
I think this can be achieved without breaking compatibility for existing code by adding a method to re-define help argument (or perhaps entirely unset it depending on method arguments). Then this method would need to be called anywhere before setting new -h
argument.
PR for this change is welcome.
@jossef FWIW, there is DisableHelp()
method that removes use of -h|--help
as automagic help arguments. This was added previously for a similar use, but I have not used it myself, so not sure if that works for your use case.
With SetHelp
from #50, we can remove the short name for help with:
parser.SetHelp("", "help")
host := parser.String("h", "host", &argparse.Options{Required: true, Help: "Host"})
If I define
I'll get a panic ->
This is because there's a built-in
-h
/--help
already occupied it.For now I can workaround it by using a different letter, but It would be a nice to have support for
h
😁