Documentation
¶
Overview ¶
Package clicobra contains helper functionality for applications using Cobra.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
type Flags struct {
// contains filtered or unexported fields
}
Flags are base flags.
func (*Flags) BindRootCommandFlags ¶ added in v0.2.0
BindRootCommandFlags binds the root-command flags.
type TimeoutFlags ¶ added in v0.2.0
type TimeoutFlags struct {
// contains filtered or unexported fields
}
TimeoutFlags are base flags with a root timeout.
func NewTimeoutFlags ¶ added in v0.2.0
func NewTimeoutFlags(devel bool) *TimeoutFlags
NewTimeoutFlags returns a new TimeoutFlags.
Devel should not be set for release binaries.
func (*TimeoutFlags) BindRootCommandFlags ¶ added in v0.2.0
func (t *TimeoutFlags) BindRootCommandFlags(flagSet *pflag.FlagSet, defaultTimeout time.Duration)
BindRootCommandFlags binds the root-command flags with timeout.
func (*TimeoutFlags) Devel ¶ added in v0.2.0
func (t *TimeoutFlags) Devel() bool
Devel returns true if devel was set.
Click to show internal directories.
Click to hide internal directories.