cmd/config: expose target for embedding config commands

This commit is contained in:
Phillip Wittrock
2019-11-25 09:56:20 -08:00
parent 9f2163ae54
commit 598854440a
3 changed files with 88 additions and 44 deletions

View File

@@ -0,0 +1,20 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package cmds_test
import (
"github.com/spf13/cobra"
"sigs.k8s.io/kustomize/cmd/config/cmds"
)
// ExampleNewConfigCommand demonstrates how to embed the config command as a command inside
// another group.
func ExampleNewConfigCommand() {
var root = &cobra.Command{
Use: "my-cmd",
Short: "My command.",
Long: `My command.`,
}
root.AddCommand(cmds.NewConfigCommand("my-cmd"))
}