slightly more ergonomic CLI ordering (#537)

This commit is contained in:
Michael Quigley 2024-12-11 13:01:40 -05:00
parent 8195736d95
commit 5c29a65474
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
3 changed files with 8 additions and 8 deletions

View File

@ -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),
@ -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())

View File

@ -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),
@ -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 {

View File

@ -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
@ -81,7 +81,7 @@ Global Flags:
Like this:
```
$ zrok admin create org-member michael.quigley@netfoundry.io gK1XRvthq7ci
$ zrok admin create org-member gK1XRvthq7ci michael.quigley@netfoundry.io
[ 0.006] INFO main.(*adminCreateOrgMemberCommand).run: added 'michael.quigley@netfoundry.io' to organization 'gK1XRvthq7ci
```