Skip to content

Commit 45b7ec7

Browse files
authored
do: improve usage section (#23782)
Currently the usage for `do` is a little confusing, because it appears that it's possible to do something without specifying a command, but it isn't really. This is because we have a `RunE` function that just prints the help. This isn't really necessary, as cobra displays the help either way if no `RunE` function is given, or when `--help` is passed. So let's just drop the function, which improves the usage section
1 parent 54b4e80 commit 45b7ec7

2 files changed

Lines changed: 0 additions & 5 deletions

File tree

‎pkg/cmd/pulumi/do/do_resource.go‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ func (pc *packageCommand) newResourceCommand(res *schema.Resource) *cobra.Comman
9595
Short: shorthelp,
9696
Long: longhelp,
9797
Args: cobra.NoArgs,
98-
RunE: func(cmd *cobra.Command, args []string) error {
99-
return cmd.Help()
100-
},
10198
}
10299
// Provider configuration applies to all sub-operations, so register here as persistent flags.
103100
cmd.PersistentFlags().StringVar(&pc.providerFile, "provider-file", "",

‎pkg/cmd/pulumi/do/do_resource_test.go‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ List Inputs:
122122
prefix (string, optional)
123123
124124
Usage:
125-
do azure:index:myResource [flags]
126125
do azure:index:myResource [command]
127126
128127
Available Commands:
@@ -172,7 +171,6 @@ Outputs:
172171
size (integer)
173172
174173
Usage:
175-
do azure:index:myResource [flags]
176174
do azure:index:myResource [command]
177175
178176
Available Commands:

0 commit comments

Comments
 (0)