Documentation ¶
Overview ¶
Package options implements command line options and manages application wide data.
Index ¶
Constants ¶
View Source
const ( OptionErrorNormalExit = iota OptionErrorUnexpected )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppOptions ¶
type AppOptions struct { VersionInformation *VersionOptions HelpInformation *HelpOptions AppName string BuildVersion string BuildDate string BuildOwner1 string BuildOwner2 string Repository string }
AppOptions stores information that is used throughout the application.
func (*AppOptions) Init ¶
func (a *AppOptions) Init() (*AppOptions, error)
Init parses command line options and updates the AppOptions data. Depending on the option, Init either handles it (e.g. --help and --version) or sets its data.
type HelpOptions ¶
type HelpOptions struct {
Help bool `short:"h" long:"help" description:"Show this help message"`
}
HelpOptions defines the properties of the '-h' or '--help' command line option.
type OptionError ¶
OptionError represents an error that occurred while parsing or handling command line options.
func (*OptionError) Error ¶
func (f *OptionError) Error() string
Error returns the error message in OptionError.
type VersionOptions ¶
type VersionOptions struct {
Version bool `short:"v" long:"version" description:"Print version information"`
}
VersionOptions defines the properties of the '-v' or '--version' command line option.
Click to show internal directories.
Click to hide internal directories.