Documentation ¶
Index ¶
- func PromptCompleter(rootCmd *cobra.Command) func(d prompt.Document) []prompt.Suggest
- func PromptExecutor(rootCmd *cobra.Command) func(s string)
- func RunShell(cmd *cobra.Command)
- func SetFlags(cmd *cobra.Command, opts ...FlagOption)
- func SetPersistentFlags(cmd *cobra.Command, opts ...FlagOption)
- type FlagOption
- func RegisterBoolFlag(name string, value bool, usage string) FlagOption
- func RegisterDurationFlag(name string, value time.Duration, usage string) FlagOption
- func RegisterInt32Flag(name string, value int32, usage string) FlagOption
- func RegisterInt64Flag(name string, value int64, usage string) FlagOption
- func RegisterInt64SliceFlag(name string, value []int64, usage string) FlagOption
- func RegisterIntFlag(name string, value int, usage string) FlagOption
- func RegisterStringFlag(name, value, usage string) FlagOption
- func RegisterStringSliceFlag(name string, value []string, usage string) FlagOption
- func RegisterUInt64Flag(name string, value uint64, usage string) FlagOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PromptCompleter ¶
PromptCompleter returns a completer function used by prompt package. This function is useful to create an interactive shell based on the rootCmd as the root commands.
func PromptExecutor ¶
PromptExecutor returns an executor function used by prompt package. This function is useful to create an interactive shell based on the rootCmd as the root commands.
func SetFlags ¶
func SetFlags(cmd *cobra.Command, opts ...FlagOption)
SetFlags applies 'opts' on 'cmd' flags in order.
func SetPersistentFlags ¶
func SetPersistentFlags(cmd *cobra.Command, opts ...FlagOption)
SetPersistentFlags applies 'opts' on 'cmd' persistent flags.
Types ¶
type FlagOption ¶
FlagOption applies some predefined configurations on a FlagSet.
func RegisterBoolFlag ¶
func RegisterBoolFlag(name string, value bool, usage string) FlagOption
func RegisterDurationFlag ¶
func RegisterDurationFlag(name string, value time.Duration, usage string) FlagOption
func RegisterInt32Flag ¶
func RegisterInt32Flag(name string, value int32, usage string) FlagOption
func RegisterInt64Flag ¶
func RegisterInt64Flag(name string, value int64, usage string) FlagOption
func RegisterInt64SliceFlag ¶
func RegisterInt64SliceFlag(name string, value []int64, usage string) FlagOption
func RegisterIntFlag ¶
func RegisterIntFlag(name string, value int, usage string) FlagOption
func RegisterStringFlag ¶
func RegisterStringFlag(name, value, usage string) FlagOption
func RegisterStringSliceFlag ¶
func RegisterStringSliceFlag(name string, value []string, usage string) FlagOption
func RegisterUInt64Flag ¶
func RegisterUInt64Flag(name string, value uint64, usage string) FlagOption
Click to show internal directories.
Click to hide internal directories.