Documentation ¶
Index ¶
- func CacheAll(_, _ string) bool
- func CacheNone(_, _ string) bool
- func Fatal(args ...any)
- func RegisterCompletionFunc(cmd *cobra.Command, completionFunc CompletionFunc)
- func Run(rootCmd *cobra.Command, maxCompletions int64)
- type CacheFunc
- func AndCacheFunc(fs ...CacheFunc) CacheFunc
- func BranchCompletion(flag, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
- func FileCompletion(flag, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
- func FilesystemCompletion(_, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
- func JobCompletion(_, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
- func JobSetCompletion(_, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
- func PipelineCompletion(_, _ string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
- func ProjectBranchCompletion(project, flag, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
- func ProjectCompletion(flag, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
- func ProjectFileCompletion(project, flag, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
- func RepoCompletion(_, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
- func SameFlag(flag string) CacheFunc
- type CompletionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCompletionFunc ¶
func RegisterCompletionFunc(cmd *cobra.Command, completionFunc CompletionFunc)
RegisterCompletionFunc registers a completion function for a command. NOTE: RegisterCompletionFunc must be called before cmd is passed to functions that make copies of it (such as cmdutil.CreateAlias. This is because RegisterCompletionFunc modifies cmd in a superficial way by adding an annotation (to the Annotations field) that associates it with the completion function. This means that
Types ¶
type CacheFunc ¶
CacheFunc is a function which returns whether or not cached results from a previous call to a CompletionFunc can be reused.
func AndCacheFunc ¶
AndCacheFunc ands 0 or more cache funcs together.
func BranchCompletion ¶
BranchCompletion completes branch parameters of the form <repo>@<branch>
func FileCompletion ¶
FileCompletion completes file parameters of the form <repo>@<branch>:/file
func FilesystemCompletion ¶
FilesystemCompletion completes file parameters from the local filesystem (not from pfs).
func JobCompletion ¶
JobCompletion completes job parameters of the form <job>
func JobSetCompletion ¶
JobCompletion completes job parameters of the form <job-set>
func PipelineCompletion ¶
PipelineCompletion completes pipeline parameters of the form <pipeline>
func ProjectBranchCompletion ¶
func ProjectBranchCompletion(project, flag, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
ProjectBranchCompletion completes branch parameters of the form <repo>@<branch> in a project-aware fashion.
func ProjectCompletion ¶
func ProjectFileCompletion ¶
func ProjectFileCompletion(project, flag, text string, maxCompletions int64) ([]prompt.Suggest, CacheFunc)
ProjectFileCompletion completes file parameters of the form <repo>@<branch>:/file in a project-aware manner.
func RepoCompletion ¶
RepoCompletion completes repo parameters of the form <repo>