Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFlags ¶
AddFlags registers this package's flags on arbitrary FlagSets, such that they point to the same value as the global flags.
func PrintAndExitIfRequested ¶
func PrintAndExitIfRequested()
PrintAndExitIfRequested will check if the -version flag was passed and, if so, print the version and exit.
func VersionVar ¶
func VersionVar(p *VersionValue, name, shortName string, value VersionValue, usage string)
VersionVar defines a flag with the specified name and usage string.
Types ¶
type VersionValue ¶
type VersionValue int
VersionValue ...
const ( VersionFalse VersionValue = 0 VersionTrue VersionValue = 1 VersionRaw VersionValue = 2 )
Define some const.
func Version ¶
func Version(name, shortName string, value VersionValue, usage string) *VersionValue
Version wraps the VersionVar function.
func (*VersionValue) String ¶
func (v *VersionValue) String() string
func (*VersionValue) Type ¶
func (v *VersionValue) Type() string
Type of the flag as required by the pflag.Value interface.
Click to show internal directories.
Click to hide internal directories.