Skip to content

Commit

Permalink
Merge pull request #6459 from kargakis/doc-get-help
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Dec 23, 2015
2 parents 2fb6435 + 149dafc commit a918f9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
9 changes: 6 additions & 3 deletions docs/generated/oc_by_example_content.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,16 @@ Display one or many resources
$ oc get pods
# List a single replication controller with specified ID in ps output format.
$ oc get replicationController 1234-56-7890-234234-456456
$ oc get rc redis
# List all pods and show more details about them.
$ oc get -o wide pods
# List a single pod in JSON output format.
$ oc get -o json pod 1234-56-7890-234234-456456
$ oc get -o json pod redis-pod
# Return only the status value of the specified pod.
$ oc get -o template pod 1234-56-7890-234234-456456 --template={{.currentState.status}}
$ oc get -o template pod redis-pod --template={{.currentState.status}}
----
====

Expand Down
15 changes: 10 additions & 5 deletions pkg/cmd/cli/cmd/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,30 @@ func tab(original string) string {
const (
getLong = `Display one or many resources
Possible resources include builds, buildConfigs, services, pods, etc.`
Possible resources include builds, buildConfigs, services, pods, etc.
Some resources may omit advanced details that you can see with '-o wide'.
If you want an even more detailed view, use '%[1]s describe'.`

getExample = ` # List all pods in ps output format.
$ %[1]s get pods
# List a single replication controller with specified ID in ps output format.
$ %[1]s get replicationController 1234-56-7890-234234-456456
$ %[1]s get rc redis
# List all pods and show more details about them.
$ %[1]s get -o wide pods
# List a single pod in JSON output format.
$ %[1]s get -o json pod 1234-56-7890-234234-456456
$ %[1]s get -o json pod redis-pod
# Return only the status value of the specified pod.
$ %[1]s get -o template pod 1234-56-7890-234234-456456 --template={{.currentState.status}}`
$ %[1]s get -o template pod redis-pod --template={{.currentState.status}}`
)

// NewCmdGet is a wrapper for the Kubernetes cli get command
func NewCmdGet(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := kcmd.NewCmdGet(f.Factory, out)
cmd.Long = getLong
cmd.Long = fmt.Sprintf(getLong, fullName)
cmd.Example = fmt.Sprintf(getExample, fullName)
cmd.SuggestFor = []string{"list"}
return cmd
Expand Down

0 comments on commit a918f9e

Please sign in to comment.