Skip to content

Commit

Permalink
Review.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Sep 19, 2024
1 parent 437dee6 commit c0fc9fa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/genericcli/cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,15 @@ func NewCmds[C any, U any, R any](c *CmdsConfig[C, U, R], additionalCmds ...*cob
}

if _, ok := c.OnlyCmds[UpdateCmd]; ok {
use := "update"
if c.UpdateRequestFromCLI != nil {
for _, arg := range c.Args {
use += fmt.Sprintf(" <%s>", arg)
}
}

cmd := &cobra.Command{
Use: "update",
Use: use,
Short: fmt.Sprintf("updates the %s", c.Singular),
RunE: func(cmd *cobra.Command, args []string) error {
if c.UpdateRequestFromCLI != nil && !viper.IsSet("file") {
Expand Down

0 comments on commit c0fc9fa

Please sign in to comment.