Skip to content

Commit

Permalink
fix: use leading colon for custom methods
Browse files Browse the repository at this point in the history
to help ensure custom methods do not conflict 
with top-level commands, introduce a colon to
provide user-defined commands their own namespaces.
  • Loading branch information
toumorokoshi committed Nov 12, 2024
1 parent 4ba1ee8 commit 2c10a39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/service/resource_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func ExecuteResourceCommand(r *api.Resource, args []string) (*http.Request, stri
for _, cm := range r.CustomMethods {
customArgs := map[string]interface{}{}
customCmd := &cobra.Command{
Use: fmt.Sprintf("%s [id]", cm.Name),
Use: fmt.Sprintf(":%s [id]", cm.Name),
Short: fmt.Sprintf("%v a %v", cm.Method, strings.ToLower(r.Singular)),
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
Expand Down

0 comments on commit 2c10a39

Please sign in to comment.