diff --git a/federation/pkg/kubefed/kubefed.go b/federation/pkg/kubefed/kubefed.go index 8676e2ae642..d7d1055dcdb 100644 --- a/federation/pkg/kubefed/kubefed.go +++ b/federation/pkg/kubefed/kubefed.go @@ -26,10 +26,20 @@ import ( kubectl "k8s.io/kubernetes/pkg/kubectl/cmd" "k8s.io/kubernetes/pkg/kubectl/cmd/templates" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" + "k8s.io/kubernetes/pkg/util/i18n" "github.com/spf13/cobra" ) +var ( + kubefedVersionExample = templates.Examples(i18n.T(` + # Print the client and server versions for the current context + kubefed version`)) + kubefedOptionsExample = templates.Examples(i18n.T(` + # Print flags inherited by all commands + kubefed options`)) +) + // NewKubeFedCommand creates the `kubefed` command and its nested children. func NewKubeFedCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer, defaultServerImage, defaultEtcdImage string) *cobra.Command { // Parent command to which all subcommands are added. @@ -66,8 +76,12 @@ func NewKubeFedCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer, defa } templates.ActsAsRootCommand(cmds, filters, groups...) - cmds.AddCommand(kubectl.NewCmdVersion(f, out)) - cmds.AddCommand(kubectl.NewCmdOptions(out)) + cmdVersion := kubectl.NewCmdVersion(f, out) + cmdVersion.Example = kubefedVersionExample + cmds.AddCommand(cmdVersion) + cmdOptions := kubectl.NewCmdOptions(out) + cmdOptions.Example = kubefedOptionsExample + cmds.AddCommand(cmdOptions) return cmds }