Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultShortUsage ¶
func DefaultUsage ¶
Types ¶
type BuildInfo ¶
type BuildInfo struct {
// contains filtered or unexported fields
}
func NewBuildInfo ¶
type Command ¶
type Command struct { Name string ShortHelp string ShortUsage string LongHelp string Flags *flag.FlagSet Exec func(ctx context.Context, args []string) error Subcommands []*Command // contains filtered or unexported fields }
func DefaultVersionCommand ¶
func NewVersionCommand ¶
func NewVersionCommand(info VersionInfo, out io.Writer) *Command
type ParseOption ¶
type ParseOption func(*ParseOptions) error
func WithEnvVarPrefix ¶
func WithEnvVarPrefix(prefix string) ParseOption
func WithEnvVars ¶
func WithEnvVars() ParseOption
type ParseOptions ¶
type ParseOptions struct {
// contains filtered or unexported fields
}
type VersionInfo ¶
type VersionInfo interface { // The version number Version() string // The revision identifier of the commit Revision() string // The modification time of the commit, in RFC3339 format Time() string // Whether the source tree had uncommitted local changes Modified() bool // The version of the Go toolchain that built the binary GoVersion() string }
func DefaultVersionInfo ¶
func DefaultVersionInfo() VersionInfo
Click to show internal directories.
Click to hide internal directories.