completion

package
v0.0.0-...-8f52349 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	// AppCompletion is the type for completing apps
	AppCompletion = "apps"

	// SourceCompletion is the type for completing sources
	SourceCompletion = "sources"

	// SpaceCompletion is the type for completing spaces
	SpaceCompletion = "spaces"
)

Variables

This section is empty.

Functions

func AddBashCompletion

func AddBashCompletion(rootCommand *cobra.Command)

AddBashCompletion adds bash completion to the given Cobra command.

func KnownGenericTypes

func KnownGenericTypes() (out []string)

KnownGenericTypes returns the keys for all registered generic types.

Example
for _, v := range KnownGenericTypes() {
	fmt.Println(v)
}
Output:

apps
sources
spaces

func MarkArgCompletionSupported

func MarkArgCompletionSupported(cmd *cobra.Command, k8sType string)

MarkArgCompletionSupported returns completion annotations for a CobraCommand

func MarkFlagCompletionSupported

func MarkFlagCompletionSupported(flags *pflag.FlagSet, name, k8sType string) error

MarkFlagCompletionSupported adds a completion annotation to a flag.

func NewNamesCommand

func NewNamesCommand(p *config.KfParams, client dynamic.Interface) *cobra.Command

NewNamesCommand generates a command to get the names of various types

func PrintNames

func PrintNames(w io.Writer, ul *unstructured.UnstructuredList)

PrintNames prints the names of objects in the given list in alphabetical order.

Example
a := unstructured.Unstructured{}
a.SetName("app-a")

z := unstructured.Unstructured{}
z.SetName("app-z")

PrintNames(os.Stdout, &unstructured.UnstructuredList{
	Items: []unstructured.Unstructured{z, a},
})
Output:

app-a app-z

Types

This section is empty.

Jump to

Keyboard shortcuts

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