Documentation ¶
Overview ¶
Package new used to generate demo command code. nolint: predeclared
Index ¶
- func NewCmdNew(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command
- type NewOptions
- func (o *NewOptions) Complete(cmd *cobra.Command, args []string) error
- func (o *NewOptions) CreateCommand() error
- func (o *NewOptions) CreateCommandWithSubCommands() error
- func (o *NewOptions) GenerateGoCode(name, codeTemplate string) error
- func (o *NewOptions) Run(args []string) error
- func (o *NewOptions) Validate(cmd *cobra.Command) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NewOptions ¶
type NewOptions struct { Group bool Outdir string // command template options, will render to command template CommandName string CommandDescription string CommandFunctionName string Dot string genericclioptions.IOStreams }
NewOptions is an options struct to support 'new' sub command.
func NewNewOptions ¶
func NewNewOptions(ioStreams genericclioptions.IOStreams) *NewOptions
NewNewOptions returns an initialized NewOptions instance.
func (*NewOptions) Complete ¶
func (o *NewOptions) Complete(cmd *cobra.Command, args []string) error
Complete completes all the required options.
func (*NewOptions) CreateCommand ¶
func (o *NewOptions) CreateCommand() error
CreateCommand create the command with options.
func (*NewOptions) CreateCommandWithSubCommands ¶
func (o *NewOptions) CreateCommandWithSubCommands() error
CreateCommandWithSubCommands create sub commands with options.
func (*NewOptions) GenerateGoCode ¶
func (o *NewOptions) GenerateGoCode(name, codeTemplate string) error
GenerateGoCode generate go source file.
func (*NewOptions) Run ¶
func (o *NewOptions) Run(args []string) error
Run executes a new sub command using the specified options.
Click to show internal directories.
Click to hide internal directories.