Documentation
¶
Index ¶
- func WrapRunE(o Runnable, f util.Factory) func(cmd *cobra.Command, args []string) error
- type Options
- func (o *Options) AddFlags(flags *pflag.FlagSet)
- func (o *Options) AllowedOutputFormats() []string
- func (o *Options) Complete(_ util.Factory, _ *cobra.Command, _ []string) error
- func (o *Options) PrintObject(obj interface{}) error
- func (o *Options) RegisterCompletionsForOutputFlag(cmd *cobra.Command)
- func (o *Options) Run(util.Factory) error
- func (o *Options) Validate() error
- type Runnable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct { // IOStreams provides the standard names for iostreams IOStreams util.IOStreams // Output defines the output format of the version information. Either 'yaml' or 'json' Output string }
Options contains all settings that are used across all commands in gardenctl.
func NewOptions ¶
NewOptions returns initialized Options.
func (*Options) AllowedOutputFormats ¶
AllowedOutputFormats returns the allowed formats for the output flag.
func (*Options) PrintObject ¶
PrintObject prints an object to IOStreams.out, using o.Output to print in the selected output format.
func (*Options) RegisterCompletionsForOutputFlag ¶
RegisterCompletionsForOutputFlag adds output flag completion to the command.
type Runnable ¶
type Runnable interface { // Complete adapts from the command line args to the data required. Complete(util.Factory, *cobra.Command, []string) error // Validate validates the provided options. Validate() error // Run does the actual work of the command. Run(util.Factory) error }
Runnable is the base interface for command options.
Click to show internal directories.
Click to hide internal directories.