Skip to content

Commit

Permalink
cli: deleting a group creates it - closes #383
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeneas Rekkas (arekkas) authored and arekkas committed Feb 24, 2017
1 parent 51fd393 commit 2038e8c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/cli/handler_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ func (h *GroupHandler) DeleteGroup(cmd *cobra.Command, args []string) {
h.M.Endpoint = h.Config.Resolve("/warden/groups")
h.M.Client = h.Config.OAuth2Client(cmd)

cc := &group.Group{ID: args[0]}
err = h.M.CreateGroup(cc)
err = h.M.DeleteGroup(args[0])
if h.M.Dry {
fmt.Printf("%s\n", err)
return
}

pkg.Must(err, "Could not create group: %s", err)
fmt.Printf("Group %s deleted.\n", cc.ID)
fmt.Printf("Group %s deleted.\n", args[0])
}

func (h *GroupHandler) AddMembers(cmd *cobra.Command, args []string) {
Expand Down

0 comments on commit 2038e8c

Please sign in to comment.