-
Notifications
You must be signed in to change notification settings - Fork 421
Open
Description
I'm probably missing something obvious, but how do I use pflag so that the only valid option is the short variant? That is, if I want just "-h" rather than something like "-h" and "--help"?
If I use:
flag.BoolVar(&help, "h", false, "Give help")
then Parse() requires --h
If I use:
flag.BoolVarP(&help, "", "h", false, "Give help")
then Parse() requires "-h" and the odd "--" whereas I was hoping an empty long-opt would have deactivated that variant.
I'm pretty sure that Posix/GNU do not insist on both variants of an option, but I've been wrong before.
Metadata
Metadata
Assignees
Labels
No labels