pflag
pflag copied to clipboard
Omit default from usage if DefValue is empty
Fix #204
This change allows a user to set Flag.DefValue
to an empty string to suppress the "(default %v)" printed in the usage line for custom Value
types that have non-standard zero values.
For example
flags:=flag.NewFlagSet("",flag.ContinueOnError)
flags.VarPF(&myValue, "value", "", "usage").DefValue = ""
Will suppress the default message in the usage line.
Hi, I wanted to know if this pull request could be approved (as I see all checks have passed) It deals with an issue that came up at my workplace and it would be very helpful. Thank you!