Documentation
¶
Overview ¶
Package clicobra contains helper functionality for applications using Cobra.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
Main runs the application using the OS runtime and calling os.Exit on the return value of Run.
Types ¶
type Command ¶
type Command struct {
// Use is the one-line usage message. Required.
Use string
// Short is the short message shown in the 'help' output. Required if Long is set.
Short string
// Long is the long message shown in the 'help <this-command>' output. Optional.
// The Short field will be prepended to the Long field with a newline.
Long string
// Args are the expected arguments. Optional.
Args cobra.PositionalArgs
// Run is the command to run. Optional.
Run func(*cli.ExecEnv) error
// BindFlags allows binding of flags on build. Optional.
BindFlags func(*pflag.FlagSet)
// SubCommands are the sub-commands. Optional.
SubCommands []*Command
}
Command is a command.
type Flags ¶
Flags are base flags.
func (*Flags) BindLogFormat ¶
BindLogFormat binds the log-format flag.
func (*Flags) BindLogLevel ¶
BindLogLevel binds the log-level flag.
Click to show internal directories.
Click to hide internal directories.