diff --git a/pkg/kubectl/cmd/get.go b/pkg/kubectl/cmd/get.go index ed7088287df..8cfdc54749c 100644 --- a/pkg/kubectl/cmd/get.go +++ b/pkg/kubectl/cmd/get.go @@ -17,6 +17,7 @@ limitations under the License. package cmd import ( + "errors" "fmt" "io" @@ -94,6 +95,23 @@ func RunGet(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string return err } + if len(args) == 0 { + fmt.Fprint(out, ` +You must specify the type of resource to get. Valid resource types include: + * pods (aka 'po') + * replicationcontrollers (aka 'rc') + * services + * nodes (aka 'no') + * events (aka 'ev') + * secrets + * limits + * persistentVolumes (aka 'pv') + * persistentVolumeClaims (aka 'pvc') + * quota +`) + return errors.New("Required resource not specified.") + } + // handle watch separately since we cannot watch multiple resource types isWatch, isWatchOnly := cmdutil.GetFlagBool(cmd, "watch"), cmdutil.GetFlagBool(cmd, "watch-only") if isWatch || isWatchOnly {