Documentation
¶
Index ¶
- func OnHelp(c *cobra.Command, h func(cmd *cobra.Command, args []string) error, ...)
- func OnPersistentPostRun(c *cobra.Command, h func(cmd *cobra.Command, args []string) error)
- func OnPersistentPreRun(c *cobra.Command, h func(cmd *cobra.Command, args []string) error, ...)
- func OnPostRun(c *cobra.Command, h func(cmd *cobra.Command, args []string) error, ...)
- func OnPreRun(c *cobra.Command, h func(cmd *cobra.Command, args []string) error, ...)
- func OnRun(c *cobra.Command, h func(cmd *cobra.Command, args []string) error)
- func Persistent(o *HookOptions)
- func RunOnHelp(o *HookOptions)
- type Command
- func (c *Command) OnHelp(h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
- func (c *Command) OnPersistentPostRun(h func(cmd *cobra.Command, args []string) error)
- func (c *Command) OnPersistentPreRun(h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
- func (c *Command) OnPostRun(h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
- func (c *Command) OnPreRun(h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
- func (c *Command) OnRun(h func(cmd *cobra.Command, args []string) error)
- type HookOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnHelp ¶
func OnHelp(c *cobra.Command, h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
OnHelp registers a hook for when help is invoked.
func OnPersistentPostRun ¶
OnPersistentPostRun registers a PostRun hook on the command and all of its childs
func OnPersistentPreRun ¶
func OnPersistentPreRun(c *cobra.Command, h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
OnPersistentPostRun registers a PreRun hook on the command and all of its childs
func OnPostRun ¶
func OnPostRun(c *cobra.Command, h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
OnPostRun registers a PostRun hook on the command.
func OnPreRun ¶
func OnPreRun(c *cobra.Command, h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
OnPreRun registers a PreRun hook on the command.
func Persistent ¶
func Persistent(o *HookOptions)
func RunOnHelp ¶
func RunOnHelp(o *HookOptions)
Types ¶
type Command ¶
func NewCommand ¶
func (*Command) OnHelp ¶
func (c *Command) OnHelp(h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
OnHelp registers a hook when help is invoked for the command
func (*Command) OnPersistentPostRun ¶
OnPersistentPostRun registers a PostRun hook on the command and all of its childs
func (*Command) OnPersistentPreRun ¶
func (c *Command) OnPersistentPreRun(h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
OnPersistentPostRun registers a PreRun hook on the command and all of its childs
func (*Command) OnPostRun ¶
func (c *Command) OnPostRun(h func(cmd *cobra.Command, args []string) error, options ...func(*HookOptions))
OnPostRun registers a PostRun hook on the command.
type HookOptions ¶
type HookOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.