completion

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFixedSuggestionsToFlag

func AddFixedSuggestionsToFlag(cmd *cobra.Command, flagName string, va ValidArgs) error

AddFixedSuggestionsToFlag add fixed suggestions to a flag

func AddSuggestionsToFlag

func AddSuggestionsToFlag(cmd *cobra.Command, flagName string, suggestFn suggestFn) error

AddSuggestionsToFlag add fixed suggestions to a flag

func CombineSuggestionsToArgs

func CombineSuggestionsToArgs(fns ...suggestFn) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CombineSuggestionsToArgs combine one or more suggestion resolver functions and call then accordingly with arg count

func GenZshCompletion

func GenZshCompletion(cmd *cobra.Command, w io.Writer) error

Types

type ValidArgs

type ValidArgs interface {
	IntoUse() string
	OnlyArgs() []string
	IntoValidArgs() []string
}

func EmptySuggestionFuncion

func EmptySuggestionFuncion(cmd *cobra.Command, args []string, toComplete string) (ValidArgs, error)

func EmptyValidArgs

func EmptyValidArgs() ValidArgs

EmptyValidArgs returns a ValidArgs with no options

type ValigsArgsMap

type ValigsArgsMap map[string]string

func (ValigsArgsMap) IntoUse

func (va ValigsArgsMap) IntoUse() string

func (ValigsArgsMap) IntoValidArgs

func (va ValigsArgsMap) IntoValidArgs() []string

func (ValigsArgsMap) OnlyArgs

func (va ValigsArgsMap) OnlyArgs() []string

func (ValigsArgsMap) Set

func (va ValigsArgsMap) Set(k, v string) ValigsArgsMap

type ValigsArgsSlide

type ValigsArgsSlide []string

func (ValigsArgsSlide) IntoUse

func (va ValigsArgsSlide) IntoUse() string

func (ValigsArgsSlide) IntoValidArgs

func (va ValigsArgsSlide) IntoValidArgs() []string

func (ValigsArgsSlide) OnlyArgs

func (va ValigsArgsSlide) OnlyArgs() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL