Documentation ¶
Index ¶
- func AddBoolFlag(cmd *Command, name, shorthand string, def bool, desc string, opts ...flagOpt)
- func AddStringFlag(cmd *Command, name, shorthand, dflt, desc string, opts ...flagOpt)
- func AddStringSliceFlag(cmd *Command, name, shorthand string, def []string, desc string, ...)
- func Execute()
- type CmdConfig
- type CmdRunner
- type Command
- type LetterPayload
- type MissingArgsErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBoolFlag ¶
AddBoolFlag adds a boolean flag to a command.
func AddStringFlag ¶
AddStringFlag adds a string flag to a command.
Types ¶
type CmdConfig ¶
type CmdConfig struct { NS string Out io.Writer Args []string // Services Categories func() client.CategoriesService Letters func() client.LettersService Organizations func() client.OrganizationsService Products func() client.ProductsService // contains filtered or unexported fields }
CmdConfig is a command configuration.
func NewCmdConfig ¶
NewCmdConfig creates an instance of a CmdConfig.
func (*CmdConfig) Display ¶
func (c *CmdConfig) Display(d displayers.Displayable) error
Display displays the output from a command.
type Command ¶
Command is a wrapper around cobra.Command that adds gocancel specific functionality.
func CmdBuilder ¶
func (*Command) AddCommand ¶
AddCommand adds child commands and adds child commands for cobra as well.
type LetterPayload ¶
type LetterPayload struct {
*gocancel.LetterRequest
}
type MissingArgsErr ¶
type MissingArgsErr struct {
Command string
}
MissingArgsErr is returned when there are too few arguments for a command.
func NewMissingArgsErr ¶
func NewMissingArgsErr(cmd string) *MissingArgsErr
NewMissingArgsErr creates a MissingArgsErr instance.
func (*MissingArgsErr) Error ¶
func (e *MissingArgsErr) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.