mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-05-12 02:58:20 +00:00
Properly Name Groups in Code
This commit is contained in:
parent
2b52c420c4
commit
94165a0f3d
1 changed files with 4 additions and 4 deletions
|
@ -55,7 +55,7 @@ func GroupList(cmd *cobra.Command, args []string) error {
|
|||
defer client.Logout(context.TODO())
|
||||
cmd.SilenceUsage = true
|
||||
|
||||
resources, err := client.GetGroups(ctx, &api.GetGroupsOptions{
|
||||
groups, err := client.GetGroups(ctx, &api.GetGroupsOptions{
|
||||
FilterHasUsers: users,
|
||||
FilterHasManagers: managers,
|
||||
})
|
||||
|
@ -65,14 +65,14 @@ func GroupList(cmd *cobra.Command, args []string) error {
|
|||
|
||||
data := pterm.TableData{columns}
|
||||
|
||||
for _, resource := range resources {
|
||||
for _, group := range groups {
|
||||
entry := make([]string, len(columns))
|
||||
for i := range columns {
|
||||
switch strings.ToLower(columns[i]) {
|
||||
case "id":
|
||||
entry[i] = resource.ID
|
||||
entry[i] = group.ID
|
||||
case "name":
|
||||
entry[i] = shellescape.StripUnsafe(resource.Name)
|
||||
entry[i] = shellescape.StripUnsafe(group.Name)
|
||||
default:
|
||||
cmd.SilenceUsage = false
|
||||
return fmt.Errorf("Unknown Column: %v", columns[i])
|
||||
|
|
Loading…
Add table
Reference in a new issue