Skip to content

Commit 9d72b67

Browse files
author
Yago Carlos Fernandez Gou
committed
Address review comments
1 parent fb2271f commit 9d72b67

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

internal/cmd/beta/intake/runner/runner.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
2020
Args: args.NoArgs,
2121
Run: utils.CmdHelp,
2222
}
23+
24+
addSubcommands(cmd, params)
25+
return cmd
26+
}
27+
28+
func addSubcommands(cmd *cobra.Command, params *types.CmdParams) {
2329
// Pass the params down to each action command
2430
cmd.AddCommand(create.NewCmd(params))
2531
cmd.AddCommand(delete.NewCmd(params))
2632
cmd.AddCommand(describe.NewCmd(params))
2733
cmd.AddCommand(list.NewCmd(params))
2834
cmd.AddCommand(update.NewCmd(params))
29-
30-
return cmd
3135
}

internal/cmd/beta/intake/user/list/list.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/stackitcloud/stackit-cli/internal/pkg/services/intake/client"
1616
"github.com/stackitcloud/stackit-cli/internal/pkg/tables"
1717
"github.com/stackitcloud/stackit-cli/internal/pkg/types"
18+
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
1819
"github.com/stackitcloud/stackit-sdk-go/services/intake"
1920
)
2021

@@ -139,16 +140,11 @@ func outputResult(p *print.Printer, outputFormat, projectLabel, intakeId string,
139140

140141
table := tables.NewTable()
141142
table.SetHeader("ID", "DISPLAY NAME", "TYPE", "STATE")
142-
for i := range users {
143-
user := users[i]
144-
userType := ""
145-
if user.Type != nil {
146-
userType = string(*user.Type)
147-
}
143+
for _, user := range users {
148144
table.AddRow(
149145
user.GetId(),
150146
user.GetDisplayName(),
151-
userType,
147+
utils.PtrString(user.Type),
152148
user.GetState(),
153149
)
154150
}

internal/cmd/beta/intake/user/user.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
2020
Args: args.NoArgs,
2121
Run: utils.CmdHelp,
2222
}
23+
24+
addSubcommands(cmd, params)
25+
return cmd
26+
}
27+
28+
func addSubcommands(cmd *cobra.Command, params *types.CmdParams) {
2329
// Pass the params down to each action command
2430
cmd.AddCommand(create.NewCmd(params))
2531
cmd.AddCommand(delete.NewCmd(params))
2632
cmd.AddCommand(describe.NewCmd(params))
2733
cmd.AddCommand(list.NewCmd(params))
2834
cmd.AddCommand(update.NewCmd(params))
29-
30-
return cmd
3135
}

0 commit comments

Comments
 (0)