diff --git a/pkg/kubectl/cmd/cmd.go b/pkg/kubectl/cmd/cmd.go index d06839698a8..2fc9c86a1e8 100644 --- a/pkg/kubectl/cmd/cmd.go +++ b/pkg/kubectl/cmd/cmd.go @@ -287,7 +287,7 @@ Find more information at https://github.com/kubernetes/kubernetes.`, NewCmdDescribe(f, out, err), NewCmdLogs(f, out), NewCmdAttach(f, in, out, err), - NewCmdExec("kubectl", f, in, out, err), + NewCmdExec(cmds.Root().CommandPath(), f, in, out, err), NewCmdPortForward(f, out, err), NewCmdProxy(f, out), }, diff --git a/pkg/kubectl/cmd/get.go b/pkg/kubectl/cmd/get.go index 4a4ea3d5e7e..86007d3ea78 100644 --- a/pkg/kubectl/cmd/get.go +++ b/pkg/kubectl/cmd/get.go @@ -171,7 +171,14 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm if len(args) == 0 && cmdutil.IsFilenameEmpty(options.Filenames) { fmt.Fprint(errOut, "You must specify the type of resource to get. ", valid_resources) - return cmdutil.UsageError(cmd, "Required resource not specified.") + + fullCmdName := cmd.Parent().CommandPath() + usageString := "Required resource not specified." + if len(fullCmdName) > 0 && cmdutil.IsCommandExists(cmd, "explain") { + usageString = fmt.Sprintf("%s\nUse \"%s explain \" for a detailed description of that resource (e.g. %[2]s explain pods).", usageString, fullCmdName) + } + + return cmdutil.UsageError(cmd, usageString) } // determine if args contains "all"