Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OneOf ¶
type OneOf struct {
// contains filtered or unexported fields
}
func (*OneOf) Complete ¶
func (o *OneOf) Complete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
Allow to use OneOf flags in the cobra autocompletion framework. For example:
loglevel := xpflag.New("info", "debug", "info", "warn", "error") cmd.Flags().Var(loglevel, "log-level", "log level, one of "+loglevel.Variants()) cmd.RegisterFlagCompletionFunc(flagName, loglevel.Complete)
Click to show internal directories.
Click to hide internal directories.