Documentation ¶
Overview ¶
Package configcobra provides a target for embedding the config command group in another cobra command.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Cat = commands.CatCommand Count = commands.CountCommand Grep = commands.GrepCommand RunFn = commands.RunCommand Tree = commands.TreeCommand StackOnError = &runner.StackOnError ExitOnError = &runner.ExitOnError )
Export commands publicly for composition
Functions ¶
func AddCommands ¶ added in v0.2.0
AddCommands adds the cfg and fn commands to kustomize.
Example ¶
ExampleAddCommands demonstrates how to embed the config command as a command inside another group.
package main import ( "os" "github.com/spf13/cobra" "sigs.k8s.io/kustomize/cmd/config/configcobra" "sigs.k8s.io/kustomize/kyaml/commandutil" ) func main() { // enable the config commands os.Setenv(commandutil.EnableAlphaCommmandsEnvName, "true") _ = configcobra.AddCommands(&cobra.Command{ Use: "my-cmd", Short: "My command.", Long: `My command.`, }, "my-cmd") }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.