Skip to content

Commit

Permalink
slightly more ergonomic CLI ordering (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Dec 11, 2024
1 parent 8195736 commit 5c29a65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cmd/zrok/adminCreateOrgMember.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type adminCreateOrgMemberCommand struct {

func newAdminCreateOrgMemberCommand() *adminCreateOrgMemberCommand {
cmd := &cobra.Command{
Use: "org-member <accountEmail> <organizationToken>",
Use: "org-member <organizationToken> <accountEmail>",
Aliases: []string{"member"},
Short: "Add an account to an organization",
Args: cobra.ExactArgs(2),
Expand All @@ -41,8 +41,8 @@ func (cmd *adminCreateOrgMemberCommand) run(_ *cobra.Command, args []string) {
}

req := admin.NewAddOrganizationMemberParams()
req.Body.Email = args[0]
req.Body.Token = args[1]
req.Body.Token = args[0]
req.Body.Email = args[1]
req.Body.Admin = cmd.admin

_, err = zrok.Admin.AddOrganizationMember(req, mustGetAdminAuth())
Expand Down
6 changes: 3 additions & 3 deletions cmd/zrok/adminDeleteOrgMember.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type adminDeleteOrgMemberCommand struct {

func newAdminDeleteOrgMemberCommand() *adminDeleteOrgMemberCommand {
cmd := &cobra.Command{
Use: "org-member <accountEmail> <organizationToken>",
Use: "org-member <organizationToken> <accountEmail>",
Aliases: []string{"member"},
Short: "Remove an account from an organization",
Args: cobra.ExactArgs(2),
Expand All @@ -39,8 +39,8 @@ func (cmd *adminDeleteOrgMemberCommand) run(_ *cobra.Command, args []string) {
}

req := admin.NewRemoveOrganizationMemberParams()
req.Body.Email = args[0]
req.Body.Token = args[1]
req.Body.Token = args[0]
req.Body.Email = args[1]

_, err = zrok.Admin.RemoveOrganizationMember(req, mustGetAdminAuth())
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/self-hosting/organizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ We use the `zrok admin create org-member` command to add members to organization
$ zrok admin create org-member
Error: accepts 2 arg(s), received 0
Usage:
zrok admin create org-member <accountEmail> <organizationToken> [flags]
zrok admin create org-member <organizationToken> <accountEmail> [flags]
Aliases:
org-member, member
Expand All @@ -81,7 +81,7 @@ Global Flags:
Like this:

```
$ zrok admin create org-member [email protected] gK1XRvthq7ci
$ zrok admin create org-member gK1XRvthq7ci [email protected]
[ 0.006] INFO main.(*adminCreateOrgMemberCommand).run: added '[email protected]' to organization 'gK1XRvthq7ci
```

Expand Down

0 comments on commit 5c29a65

Please sign in to comment.