Documentation ¶
Index ¶
- func NewCliCommand(ctx clictx.Context, mod ...func(clictx.Context, *cobra.Command)) *cobra.Command
- func NewCliCommandForArgs(ctx clictx.Context, args []string, mod ...func(clictx.Context, *cobra.Command)) (*cobra.Command, error)
- func NewVersionCommand(ctx clictx.Context) *cobra.Command
- type CLIOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCliCommand ¶
NewCliCommand creates a new command WITHOUT observing configuration options. The result is a command configured by pure defaults. This is especially true for plugin settings.
func NewCliCommandForArgs ¶
func NewCliCommandForArgs(ctx clictx.Context, args []string, mod ...func(clictx.Context, *cobra.Command)) (*cobra.Command, error)
NewCliCommandForArgs is the regular way to instantiate a new CLI command. It observes settings provides by options for the main command. This especially means, that help texts are configured according to the config settings provided by options.
Types ¶
type CLIOptions ¶
type CLIOptions struct { config2.Config Completed bool Version bool *config2.EvaluatedOptions Context clictx.Context }
func Prepare ¶
Prepare pre-prepares CLI options by evaluation the main options and providing an appropriately configured cli context.
func (*CLIOptions) AddFlags ¶
func (o *CLIOptions) AddFlags(fs *pflag.FlagSet)
func (*CLIOptions) Close ¶
func (o *CLIOptions) Close() error
func (*CLIOptions) Complete ¶
func (o *CLIOptions) Complete() error
Click to show internal directories.
Click to hide internal directories.