Documentation ¶
Overview ¶
Package cli contains common command-line flags and configuration options.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrExitVersion is an error indicating the application should exit after // showing version. ErrExitVersion = errors.New("version flag exit") // ErrArgsNeeded is an error indicating the application needed some additional // flags or arguments passed to continue. ErrArgsNeeded = errors.New("additional flags or arguments needed") )
Functions ¶
Types ¶
type App ¶ added in v0.3.0
type App struct { Name string // Name of the application. Description string // Description of the application. ArgsUsage string // Usage message for the command-line arguments. Flags *flag.FlagSet // Command-line flags. }
App represents a command-line application.
func (*App) HandleStartup ¶ added in v0.3.0
HandleStartup handles the command startup. All exported fields shouldn't be modified after HandleStartup is called.
It sets up the command-line flags, parses the arguments, and handles the version flag if specified.
Click to show internal directories.
Click to hide internal directories.