Documentation ¶
Index ¶
- Variables
- func PositionalArgs(aargs []RequiredArg, preHook func(cmd *cobra.Command)) cobra.PositionalArgs
- func PromptUiConfirmFunc(label string, defaultValue bool) func(validator types.Validator[bool]) (bool, error)
- func PromptUiFunc[T comparable](label string) func(validator types.Validator[T]) (string, error)
- func PromptUiSelectorFunc[T comparable](label string, longLabel string, result func(int) error, ...) func(validator types.Validator[T]) (string, error)
- func PromptUiSelectorNewFunc[T comparable](label string, longLabel string, result func(int) error, ...) func(validator types.Validator[T]) (string, error)
- func RunSubCommand(cmd *cobra.Command, cmds []SelectableCommand)
- func SubCommandRequired(next ...cobra.PositionalArgs) cobra.PositionalArgs
- func UseInteractive() bool
- type Arg
- type RequiredArg
- type SelectableCommand
- type UiFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIgnoreValue = errors.New("ignore value")
Functions ¶
func PositionalArgs ¶
func PositionalArgs(aargs []RequiredArg, preHook func(cmd *cobra.Command)) cobra.PositionalArgs
func PromptUiConfirmFunc ¶
func PromptUiFunc ¶
func PromptUiSelectorFunc ¶
func PromptUiSelectorNewFunc ¶
func RunSubCommand ¶
func RunSubCommand(cmd *cobra.Command, cmds []SelectableCommand)
func SubCommandRequired ¶
func SubCommandRequired(next ...cobra.PositionalArgs) cobra.PositionalArgs
func UseInteractive ¶
func UseInteractive() bool
Types ¶
type Arg ¶
type Arg[T comparable] struct { Name string Ptr *T Disabled types.Future[bool] Positional bool Validator types.Validator[T] UI UiFunc[T] Callback func(T) error }
func (Arg[T]) ToRequiredArg ¶
func (p Arg[T]) ToRequiredArg() rArgInterface
type RequiredArg ¶
type RequiredArg interface {
ToRequiredArg() rArgInterface
}
type SelectableCommand ¶
type SelectableCommand interface { types.Selectable Command() *cobra.Command }
func CmdSelectable ¶
func CmdSelectable(cmd *cobra.Command) SelectableCommand
Click to show internal directories.
Click to hide internal directories.