Documentation ¶
Overview ¶
Package command implements helpers useful for when building cobra commands.
Index ¶
- Variables
- func FromContext(ctx context.Context) *cobra.Command
- func New(usage, short, long string, fn Runner, p ...Preparer) *cobra.Command
- func NewContext(ctx context.Context, cmd *cobra.Command) context.Context
- func RequireSession(ctx context.Context) (context.Context, error)
- func WrapRunE(fn func(*cobra.Command, []string) error) func(*cobra.Command, []string) error
- type Preparer
- type Runner
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplementedYet = errors.New("command not implemented yet")
TODO: remove once all commands are implemented.
Functions ¶
func FromContext ¶
FromContext returns the Command ctx carries. It panics in case ctx carries no Command.
func NewContext ¶
NewContext derives a context that carries cmd from ctx.
func RequireSession ¶
RequireSession is a Preparer which makes sure a session exists.
Types ¶
Directories ¶
Path | Synopsis |
---|---|
Package apps implements the apps command chain.
|
Package apps implements the apps command chain. |
Package root implements the root command.
|
Package root implements the root command. |
Package version implements the version command chain.
|
Package version implements the version command chain. |
Click to show internal directories.
Click to hide internal directories.