mirror of https://github.com/knative/client.git
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:
parent
585fe80099
commit
8736395bcc
|
|
@ -31,6 +31,13 @@ func NewServiceCreateCommand(p *KnParams) *cobra.Command {
|
||||||
serviceCreateCommand := &cobra.Command{
|
serviceCreateCommand := &cobra.Command{
|
||||||
Use: "create NAME --image IMAGE",
|
Use: "create NAME --image IMAGE",
|
||||||
Short: "Create a service.",
|
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) {
|
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
return errors.New("requires the service name.")
|
return errors.New("requires the service name.")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue