Documentation ¶
Index ¶
- Constants
- func AddBashCompletion(rootCommand *cobra.Command)
- func KnownGenericTypes() (out []string)
- func MarkArgCompletionSupported(cmd *cobra.Command, k8sType string)
- func MarkFlagCompletionSupported(flags *pflag.FlagSet, name, k8sType string) error
- func NewNamesCommand(p *config.KfParams, client dynamic.Interface) *cobra.Command
- func PrintNames(w io.Writer, ul *unstructured.UnstructuredList)
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 ¶
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 ¶
MarkArgCompletionSupported returns completion annotations for a CobraCommand
func MarkFlagCompletionSupported ¶
MarkFlagCompletionSupported adds a completion annotation to a flag.
func NewNamesCommand ¶
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.
Click to show internal directories.
Click to hide internal directories.