Refactor kustomize config command structure

- Create cfg, fn, live parent commands
This commit is contained in:
Phillip Wittrock
2020-06-03 13:17:30 -07:00
committed by Phillip Wittrock
parent 73157c7141
commit 701c217791
68 changed files with 669 additions and 3846 deletions

View File

@@ -11,15 +11,14 @@ import (
"sigs.k8s.io/kustomize/kyaml/commandutil"
)
// ExampleNewConfigCommand demonstrates how to embed the config command as a command inside
// ExampleAddCommands demonstrates how to embed the config command as a command inside
// another group.
func ExampleNewConfigCommand() {
func ExampleAddCommands() {
// enable the config commands
os.Setenv(commandutil.EnableAlphaCommmandsEnvName, "true")
var root = &cobra.Command{
_ = configcobra.AddCommands(&cobra.Command{
Use: "my-cmd",
Short: "My command.",
Long: `My command.`,
}
root.AddCommand(configcobra.NewConfigCommand("my-cmd"))
}, "my-cmd")
}