Add a better help message for kubectl describe
When resource type isn't given in the command, print the possible resource types. Also added the resource type description in help strings.
This commit is contained in:
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
@@ -101,25 +100,8 @@ 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 resource types include:
|
||||
* componentStatuses (aka 'cs')
|
||||
* endpoints (aka 'ep')
|
||||
* events (aka 'ev')
|
||||
* limits
|
||||
* namespaces
|
||||
* nodes (aka 'no')
|
||||
* persistentVolumeClaims (aka 'pvc')
|
||||
* persistentVolumes (aka 'pv')
|
||||
* pods (aka 'po')
|
||||
* podTemplates
|
||||
* quota
|
||||
* replicationcontrollers (aka 'rc')
|
||||
* secrets
|
||||
* serviceAccounts
|
||||
* services
|
||||
`)
|
||||
return errors.New("Required resource not specified.")
|
||||
fmt.Fprint(out, "You must specify the type of resource to get. ", valid_resources)
|
||||
return cmdutil.UsageError(cmd, "Required resource not specified.")
|
||||
}
|
||||
|
||||
// handle watch separately since we cannot watch multiple resource types
|
||||
|
Reference in New Issue
Block a user