Better help message for get and describe

Add tips for shortcut ns and ep.
This commit is contained in:
hurf
2015-07-30 16:43:42 +08:00
parent 41de62b465
commit 029ed15be5
7 changed files with 23 additions and 20 deletions

View File

@@ -95,13 +95,14 @@ __custom_func() {
* pods (aka 'po')
* replicationcontrollers (aka 'rc')
* services (aka 'svc')
* nodes (aka 'no')
* events (aka 'ev')
* nodes (aka 'no')
* namespaces (aka 'ns')
* secrets
* limits
* persistentVolumes (aka 'pv')
* persistentVolumeClaims (aka 'pvc')
* quota
* persistentvolumes (aka 'pv')
* persistentvolumeclaims (aka 'pvc')
* limitranges (aka 'limits')
* resourcequotas (aka 'quota')
`
)

View File

@@ -43,9 +43,9 @@ will first check for an exact match on RESOURCE and NAME_PREFIX. If no such reso
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),
replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs),
limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc),
resourcequotas (quota) or secrets.`
replicationcontrollers (rc), nodes (no), events (ev), limitranges (limits),
persistentvolumes (pv), persistentvolumeclaims (pvc), resourcequotas (quota),
namespaces (ns) or secrets.`
describe_example = `// Describe a node
$ kubectl describe nodes kubernetes-minion-emt8.c.myproject.internal

View File

@@ -35,7 +35,7 @@ const (
Possible resources include (case insensitive): pods (po), services (svc),
replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs),
limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc),
resourcequotas (quota) or secrets.
resourcequotas (quota), namespaces (ns), endpoints (ep) or secrets.
By specifying the output as 'template' and providing a Go template as the value
of the --template flag, you can filter the attributes of the fetched resource(s).`
@@ -100,7 +100,9 @@ func RunGet(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string
}
if len(args) == 0 {
fmt.Fprint(out, "You must specify the type of resource to get. ", valid_resources)
fmt.Fprint(out, "You must specify the type of resource to get. ", valid_resources, ` * componentstatuses (aka 'cs')
* endpoints (aka 'ep')
`)
return cmdutil.UsageError(cmd, "Required resource not specified.")
}