mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-18 10:08:34 +00:00
cmd/config: expose target for embedding config commands
This commit is contained in:
20
cmd/config/cmds/example_test.go
Normal file
20
cmd/config/cmds/example_test.go
Normal 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"))
|
||||
}
|
||||
Reference in New Issue
Block a user