completion

package
v0.28.14 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 16 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterCompletionFunc

func ClusterCompletionFunc(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

ClusterCompletionFunc is a completion function that completes as a first argument the cluster names that match the toComplete prefix

func CompGetContainers

func CompGetContainers(f cmdutil.Factory, podName string, toComplete string) []string

CompGetContainers gets the list of containers of the specified pod which begin with `toComplete`.

func CompGetFromTemplate

func CompGetFromTemplate(template *string, f cmdutil.Factory, namespace string, args []string, toComplete string) []string

CompGetFromTemplate executes a Get operation using the specified template and args and returns the results which begin with `toComplete`.

func CompGetResource

func CompGetResource(f cmdutil.Factory, resourceName string, toComplete string) []string

CompGetResource gets the list of the resource specified which begin with `toComplete`.

func ContainerCompletionFunc

func ContainerCompletionFunc(f cmdutil.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

ContainerCompletionFunc Returns a completion function that completes the containers within the pod specified by the first argument. The resource containing the pod can be specified in the <type>/<name> form.

func ContextCompletionFunc

func ContextCompletionFunc(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

ContextCompletionFunc is a completion function that completes as a first argument the context names that match the toComplete prefix

func ListClustersInConfig

func ListClustersInConfig(toComplete string) []string

ListClustersInConfig returns a list of cluster names which begin with `toComplete`

func ListContextsInConfig

func ListContextsInConfig(toComplete string) []string

ListContextsInConfig returns a list of context names which begin with `toComplete`

func ListUsersInConfig

func ListUsersInConfig(toComplete string) []string

ListUsersInConfig returns a list of user names which begin with `toComplete`

func PodResourceNameAndContainerCompletionFunc

func PodResourceNameAndContainerCompletionFunc(f cmdutil.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

PodResourceNameAndContainerCompletionFunc Returns a completion function that completes, as a first argument: 1- pod names that match the toComplete prefix 2- resource types containing pods which match the toComplete prefix and as a second argument the containers within the specified pod.

func PodResourceNameCompletionFunc

func PodResourceNameCompletionFunc(f cmdutil.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

PodResourceNameCompletionFunc Returns a completion function that completes: 1- pod names that match the toComplete prefix 2- resource types containing pods which match the toComplete prefix

func ResourceNameCompletionFunc

func ResourceNameCompletionFunc(f cmdutil.Factory, resourceType string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

ResourceNameCompletionFunc Returns a completion function that completes as a first argument the resource names specified by the resourceType parameter, and which match the toComplete prefix. This function does NOT support the <type>/<name> form: it is meant to be used by commands that don't support that form. For commands that apply to pods and that support the <type>/<name> form, please use PodResourceNameCompletionFunc()

func ResourceTypeAndNameCompletionFunc

func ResourceTypeAndNameCompletionFunc(f cmdutil.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

ResourceTypeAndNameCompletionFunc Returns a completion function that completes resource types and resource names that match the toComplete prefix. It supports the <type>/<name> form.

func SetFactoryForCompletion

func SetFactoryForCompletion(f cmdutil.Factory)

SetFactoryForCompletion Store the factory which is needed by the completion functions. Not all commands have access to the factory, so cannot pass it to the completion functions.

func SpecifiedResourceTypeAndNameCompletionFunc

func SpecifiedResourceTypeAndNameCompletionFunc(f cmdutil.Factory, allowedTypes []string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

SpecifiedResourceTypeAndNameCompletionFunc Returns a completion function that completes resource types limited to the specified allowedTypes, and resource names that match the toComplete prefix. It allows for multiple resources. It supports the <type>/<name> form.

func SpecifiedResourceTypeAndNameNoRepeatCompletionFunc

func SpecifiedResourceTypeAndNameNoRepeatCompletionFunc(f cmdutil.Factory, allowedTypes []string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

SpecifiedResourceTypeAndNameNoRepeatCompletionFunc Returns a completion function that completes resource types limited to the specified allowedTypes, and resource names that match the toComplete prefix. It only allows for one resource. It supports the <type>/<name> form.

func UserCompletionFunc

func UserCompletionFunc(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

UserCompletionFunc is a completion function that completes as a first argument the user names that match the toComplete prefix

Types

This section is empty.

Jump to

Keyboard shortcuts

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