Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Usage ¶
func Usage(wrapUsage func(), message string) func()
Usage wraps a passed in func() with a func() that sets os.Args[0] to a string and then calls the func().
It is intended to be called with Usage function from a flag package, such as flag or spf13/pflag. E.g., flag.usage = util.Usage(flag.Usage, "some message")
Usage must not import "flag", since callers might use an alternate flags package such as spf13/pflag, and would set Usage for a flag package that the caller is not using.
Types ¶
This section is empty.