Documentation ¶
Overview ¶
Package cobraproxy is a package that provides a cobra proxy for the app.
Index ¶
- type Cobra
- type CobraProxy
- type CommandInstance
- func (c *CommandInstance) AddCommand(cmds ...*CommandInstance)
- func (c *CommandInstance) Execute() error
- func (c *CommandInstance) GetCommand() *cobra.Command
- func (c *CommandInstance) PersistentFlags() *pflagproxy.FlagSetInstance
- func (c *CommandInstance) RunE(cmd *cobra.Command, args []string) error
- func (c *CommandInstance) SetArgs(args []string)
- func (c *CommandInstance) SetErr(io ioproxy.WriterInstanceInterface)
- func (c *CommandInstance) SetHelpTemplate(s string)
- func (c *CommandInstance) SetOut(io ioproxy.WriterInstanceInterface)
- type CommandInstanceInterface
- type PositionalArgsInstance
- type PositionalArgsInstanceInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cobra ¶
type Cobra interface { MaximumNArgs(int) *PositionalArgsInstance NewCommand() *CommandInstance }
Cobra is an interface for cobra.
type CobraProxy ¶
type CobraProxy struct{}
CobraProxy is a struct that implements Cobra.
func (*CobraProxy) MaximumNArgs ¶
func (*CobraProxy) MaximumNArgs(n int) *PositionalArgsInstance
MaximumNArgs is a proxy for cobra.MaximumNArgs.
func (*CobraProxy) NewCommand ¶
func (*CobraProxy) NewCommand() *CommandInstance
NewCommand is a proxy for getting cobra.Command struct.
type CommandInstance ¶
CommandInstance is a struct that implements CommandInstanceInterface.
func (*CommandInstance) AddCommand ¶
func (c *CommandInstance) AddCommand(cmds ...*CommandInstance)
AddCommand is a proxy for cobra.Command.AddCommand.
func (*CommandInstance) Execute ¶
func (c *CommandInstance) Execute() error
Execute is a proxy for cobra.Command.Execute.
func (*CommandInstance) GetCommand ¶
func (c *CommandInstance) GetCommand() *cobra.Command
GetCommand returns the cobra.Command.
func (*CommandInstance) PersistentFlags ¶
func (c *CommandInstance) PersistentFlags() *pflagproxy.FlagSetInstance
PersistentFlags is a proxy for cobra.Command.PersistentFlags.
func (*CommandInstance) RunE ¶ added in v1.2.0
func (c *CommandInstance) RunE(cmd *cobra.Command, args []string) error
RunE is a proxy for cobra.Command.RunE.
func (*CommandInstance) SetArgs ¶
func (c *CommandInstance) SetArgs(args []string)
SetArgs is a proxy for cobra.Command.SetArgs.
func (*CommandInstance) SetErr ¶
func (c *CommandInstance) SetErr(io ioproxy.WriterInstanceInterface)
SetErr is a proxy for cobra.Command.SetErr.
func (*CommandInstance) SetHelpTemplate ¶
func (c *CommandInstance) SetHelpTemplate(s string)
SetHelpTemplate is a proxy for cobra.Command.SetHelpTemplate.
func (*CommandInstance) SetOut ¶
func (c *CommandInstance) SetOut(io ioproxy.WriterInstanceInterface)
type CommandInstanceInterface ¶
type CommandInstanceInterface interface { AddCommand(cmds ...*CommandInstance) Execute() error GetCommand() *cobra.Command PersistentFlags() *pflagproxy.FlagSetInstance RunE(cmd *cobra.Command, args []string) error SetArgs(args []string) SetErr(io ioproxy.WriterInstanceInterface) SetHelpTemplate(s string) SetOut(io ioproxy.WriterInstanceInterface) }
CommandInstanceInterface is an interface for cobra.Command.
type PositionalArgsInstance ¶
type PositionalArgsInstance struct {
FieldPositionalArgs cobra.PositionalArgs
}
PositionalArgsInstance is a struct that implements PositionalArgsInstanceInterface.
type PositionalArgsInstanceInterface ¶
type PositionalArgsInstanceInterface interface { }
PositionalArgsInstanceInterface is an interface for cobra.PositionalArgs.