Skip to content

Commit bdb5e3d

Browse files
authored
cmd: mark --type flag as required for plan cancel (#184)
Fixes an issue where a required flag had an "Optional" prefix in the description. I've also taken the opportunity to update the command to use the recommended CLI syntax
1 parent a88c221 commit bdb5e3d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cmd/deployment/plan/cancel.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929

3030
// cancelPlan is the deployment subcommand
3131
var cancelPlan = &cobra.Command{
32-
Use: "cancel <deployment id> --type <type> --ref-id <ref-id>",
32+
Use: "cancel <deployment id> --type <type> [--ref-id <ref-id>]",
3333
Short: "Cancels a resource's pending plan",
3434
PreRunE: sdkcmdutil.MinimumNArgsAndUUID(1),
3535
RunE: func(cmd *cobra.Command, args []string) error {
@@ -53,7 +53,7 @@ var cancelPlan = &cobra.Command{
5353

5454
func init() {
5555
Command.AddCommand(cancelPlan)
56-
cmdutil.AddTypeFlag(cancelPlan, "Optional", true)
56+
cmdutil.AddTypeFlag(cancelPlan, "Required", true)
5757
cancelPlan.MarkFlagRequired("type")
58-
cancelPlan.Flags().String("ref-id", "", "Optional deployment type RefId, if not set, the RefId will be auto-discovered")
58+
cancelPlan.Flags().String("ref-id", "", "Optional deployment RefId, if not set, the RefId will be auto-discovered")
5959
}

docs/ecctl_deployment_plan_cancel.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ Cancels a resource's pending plan
77
Cancels a resource's pending plan
88

99
```
10-
ecctl deployment plan cancel <deployment id> --type <type> --ref-id <ref-id> [flags]
10+
ecctl deployment plan cancel <deployment id> --type <type> [--ref-id <ref-id>] [flags]
1111
```
1212

1313
### Options
1414

1515
```
1616
-h, --help help for cancel
17-
--ref-id string Optional deployment type RefId, if not set, the RefId will be auto-discovered
18-
--type string Optional deployment resource type (apm, appsearch, kibana, elasticsearch)
17+
--ref-id string Optional deployment RefId, if not set, the RefId will be auto-discovered
18+
--type string Required deployment resource type (apm, appsearch, kibana, elasticsearch)
1919
```
2020

2121
### Options inherited from parent commands

0 commit comments

Comments
 (0)