mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 19:28:16 +00:00
Improve kubectl help with examples.
This commit is contained in:
@@ -22,14 +22,23 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
|
||||
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
||||
"k8s.io/kubernetes/pkg/version"
|
||||
)
|
||||
|
||||
var (
|
||||
version_example = templates.Examples(`
|
||||
# Print the client and server versions for the current context
|
||||
kubectl version`)
|
||||
)
|
||||
|
||||
func NewCmdVersion(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Print the client and server version information",
|
||||
Use: "version",
|
||||
Short: "Print the client and server version information",
|
||||
Long: "Print the client and server version information for the current context",
|
||||
Example: version_example,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
err := RunVersion(f, out, cmd)
|
||||
cmdutil.CheckErr(err)
|
||||
|
||||
Reference in New Issue
Block a user