Documentation
¶
Overview ¶
Package complex demonstrates advanced usage with CommonOptions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQueryCommand ¶
NewQueryCommand returns a command with default options.
Types ¶
type QueryCommand ¶
type QueryCommand struct {
*QueryOptions
}
QueryCommand implements Command interface. Through pointer embedding of *QueryOptions, it also satisfies Options and ComplexOptions.
type QueryOptions ¶
type QueryOptions struct {
cli.CommonOptions
Resource string
Limit int
}
QueryOptions implements Options and ComplexOptions interfaces. By embedding CommonOptions, it inherits Workspace and Logger fields.
func (*QueryOptions) BindFlags ¶
func (o *QueryOptions) BindFlags(fs *pflag.FlagSet)
BindFlags implements Options interface.
func (*QueryOptions) Complete ¶
func (o *QueryOptions) Complete(cmd *cobra.Command, args []string) error
Complete implements ComplexOptions interface. MUST call embedded CommonOptions.Complete to initialize Logger.
func (*QueryOptions) Validate ¶
func (o *QueryOptions) Validate() error
Validate implements ComplexOptions interface. MUST call embedded CommonOptions.Validate first, then add custom validation.