Adds example usage in service create command (#62)

* Adds example usage in service create command

 Fixes #61
 Adds two examples to service create command as below

```
Examples:

kn service create mysvc --image dev.local/ns/image:latest

kn service create mysvc --env KEY1=VALUE1 --env KEY2=VALUE2 --image dev.local/ns/image:latest

```

* Adds double spaces in the example text

 Adding double spaces to properly aligns the example
 text while displaying help.
This commit is contained in:
Navid Shaikh 2019-04-08 23:21:03 +05:30 committed by Knative Prow Robot
parent 585fe80099
commit 8736395bcc
1 changed files with 7 additions and 0 deletions

View File

@ -31,6 +31,13 @@ func NewServiceCreateCommand(p *KnParams) *cobra.Command {
serviceCreateCommand := &cobra.Command{
Use: "create NAME --image IMAGE",
Short: "Create a service.",
Example: `
# Create a service 'mysvc' using image at dev.local/ns/image:latest
kn service create mysvc --image dev.local/ns/image:latest
# Create a service with multiple environment variables
kn service create mysvc --env KEY1=VALUE1 --env KEY2=VALUE2 --image dev.local/ns/image:latest`,
RunE: func(cmd *cobra.Command, args []string) (err error) {
if len(args) != 1 {
return errors.New("requires the service name.")