Use TYPE instead of RESOURCE in help string

For commands in kubectl, use TYPE in help string.
This commit is contained in:
hurf
2015-07-06 19:31:27 +08:00
parent 159ba48932
commit 33fb6170f9
21 changed files with 39 additions and 45 deletions

View File

@@ -61,7 +61,7 @@ $ kubectl delete pods --all`
func NewCmdDelete(f *cmdutil.Factory, out io.Writer) *cobra.Command {
var filenames util.StringList
cmd := &cobra.Command{
Use: "delete ([-f FILENAME] | (RESOURCE [(NAME | -l label | --all)]",
Use: "delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])",
Short: "Delete resources by filenames, stdin, resources and names, or by resources and label selector.",
Long: delete_long,
Example: delete_example,

View File

@@ -37,9 +37,9 @@ const (
This command joins many API calls together to form a detailed description of a
given resource or group of resources.
$ kubectl describe RESOURCE NAME_PREFIX
$ kubectl describe TYPE NAME_PREFIX
will first check for an exact match on RESOURCE and NAME_PREFIX. If no such resource
will first check for an exact match on TYPE and NAME_PREFIX. If no such resource
exists, it will output details for every resource that has a name prefixed with NAME_PREFIX
Possible resources include (case insensitive): pods (po), services (svc),
@@ -62,7 +62,7 @@ $ kubectl describe pods frontend`
func NewCmdDescribe(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "describe (RESOURCE NAME_PREFIX | RESOURCE/NAME)",
Use: "describe (TYPE [(NAME_PREFIX | -l label] | TYPE/NAME)",
Short: "Show details of a specific resource or group of resources",
Long: describe_long,
Example: describe_example,

View File

@@ -46,7 +46,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream`
func NewCmdExposeService(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "expose RESOURCE NAME --port=port [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--public-ip=ip] [--type=type]",
Use: "expose TYPE NAME --port=port [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--public-ip=ip] [--type=type]",
Short: "Take a replicated application and expose it as Kubernetes Service",
Long: expose_long,
Example: expose_example,

View File

@@ -32,7 +32,7 @@ import (
const (
get_long = `Display one or many resources.
Possible resources include (case insensitive): pods (po), services (svc),
Possible resource types include (case insensitive): pods (po), services (svc),
replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs),
limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc),
resourcequotas (quota), namespaces (ns), endpoints (ep) or secrets.
@@ -68,7 +68,7 @@ func NewCmdGet(f *cmdutil.Factory, out io.Writer) *cobra.Command {
validArgs := p.HandledResources()
cmd := &cobra.Command{
Use: "get [(-o|--output=)json|yaml|template|wide|...] (RESOURCE [NAME] | RESOURCE/NAME ...)",
Use: "get [(-o|--output=)json|yaml|template|wide|...] (TYPE [(NAME | -l label] | TYPE/NAME ...)",
Short: "Display one or many resources",
Long: get_long,
Example: get_example,

View File

@@ -54,7 +54,7 @@ $ kubectl label pods foo bar-`
func NewCmdLabel(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "label [--overwrite] RESOURCE NAME KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]",
Use: "label [--overwrite] TYPE NAME KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]",
Short: "Update the labels on a resource",
Long: fmt.Sprintf(label_long, util.LabelValueMaxLength),
Example: label_example,

View File

@@ -42,7 +42,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve
func NewCmdPatch(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "patch RESOURCE NAME -p PATCH",
Use: "patch TYPE NAME -p PATCH",
Short: "Update field(s) of a resource by stdin.",
Long: patch_long,
Example: patch_example,

View File

@@ -49,7 +49,7 @@ $ kubectl scale --replicas=5 rc/foo rc/bar`
// NewCmdScale returns a cobra command with the appropriate configuration and flags to run scale
func NewCmdScale(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT RESOURCE NAME",
Use: "scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT TYPE NAME",
// resize is deprecated
Aliases: []string{"resize"},
Short: "Set a new size for a Replication Controller.",
@@ -79,7 +79,7 @@ func RunScale(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
count := cmdutil.GetFlagInt(cmd, "replicas")
if count < 0 {
return cmdutil.UsageError(cmd, "--replicas=COUNT RESOURCE NAME")
return cmdutil.UsageError(cmd, "--replicas=COUNT TYPE NAME")
}
cmdNamespace, _, err := f.DefaultNamespace()

View File

@@ -29,7 +29,7 @@ import (
const (
stop_long = `Deprecated: Gracefully shut down a resource by name or filename.
stop command is deprecated, all its functionalities are covered by delete command.
The stop command is deprecated, all its functionalities are covered by delete command.
See 'kubectl delete --help' for more details.
Attempts to shut down and delete a resource that supports graceful termination.
@@ -52,7 +52,7 @@ func NewCmdStop(f *cmdutil.Factory, out io.Writer) *cobra.Command {
Filenames util.StringList
}{}
cmd := &cobra.Command{
Use: "stop (-f FILENAME | RESOURCE (NAME | -l label | --all))",
Use: "stop (-f FILENAME | TYPE (NAME | -l label | --all))",
Short: "Deprecated: Gracefully shut down a resource by name or filename.",
Long: stop_long,
Example: stop_example,