mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 00:52:55 +00:00
Refactor kustomize config command structure
- Create cfg, fn, live parent commands
This commit is contained in:
committed by
Phillip Wittrock
parent
73157c7141
commit
701c217791
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user