mirror of
https://github.com/openziti/zrok.git
synced 2025-01-18 11:58:17 +01:00
slightly more ergonomic CLI ordering (#537)
This commit is contained in:
parent
8195736d95
commit
5c29a65474
@ -18,7 +18,7 @@ type adminCreateOrgMemberCommand struct {
|
|||||||
|
|
||||||
func newAdminCreateOrgMemberCommand() *adminCreateOrgMemberCommand {
|
func newAdminCreateOrgMemberCommand() *adminCreateOrgMemberCommand {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "org-member <accountEmail> <organizationToken>",
|
Use: "org-member <organizationToken> <accountEmail>",
|
||||||
Aliases: []string{"member"},
|
Aliases: []string{"member"},
|
||||||
Short: "Add an account to an organization",
|
Short: "Add an account to an organization",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
@ -41,8 +41,8 @@ func (cmd *adminCreateOrgMemberCommand) run(_ *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
req := admin.NewAddOrganizationMemberParams()
|
req := admin.NewAddOrganizationMemberParams()
|
||||||
req.Body.Email = args[0]
|
req.Body.Token = args[0]
|
||||||
req.Body.Token = args[1]
|
req.Body.Email = args[1]
|
||||||
req.Body.Admin = cmd.admin
|
req.Body.Admin = cmd.admin
|
||||||
|
|
||||||
_, err = zrok.Admin.AddOrganizationMember(req, mustGetAdminAuth())
|
_, err = zrok.Admin.AddOrganizationMember(req, mustGetAdminAuth())
|
||||||
|
@ -17,7 +17,7 @@ type adminDeleteOrgMemberCommand struct {
|
|||||||
|
|
||||||
func newAdminDeleteOrgMemberCommand() *adminDeleteOrgMemberCommand {
|
func newAdminDeleteOrgMemberCommand() *adminDeleteOrgMemberCommand {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "org-member <accountEmail> <organizationToken>",
|
Use: "org-member <organizationToken> <accountEmail>",
|
||||||
Aliases: []string{"member"},
|
Aliases: []string{"member"},
|
||||||
Short: "Remove an account from an organization",
|
Short: "Remove an account from an organization",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
@ -39,8 +39,8 @@ func (cmd *adminDeleteOrgMemberCommand) run(_ *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
req := admin.NewRemoveOrganizationMemberParams()
|
req := admin.NewRemoveOrganizationMemberParams()
|
||||||
req.Body.Email = args[0]
|
req.Body.Token = args[0]
|
||||||
req.Body.Token = args[1]
|
req.Body.Email = args[1]
|
||||||
|
|
||||||
_, err = zrok.Admin.RemoveOrganizationMember(req, mustGetAdminAuth())
|
_, err = zrok.Admin.RemoveOrganizationMember(req, mustGetAdminAuth())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -64,7 +64,7 @@ We use the `zrok admin create org-member` command to add members to organization
|
|||||||
$ zrok admin create org-member
|
$ zrok admin create org-member
|
||||||
Error: accepts 2 arg(s), received 0
|
Error: accepts 2 arg(s), received 0
|
||||||
Usage:
|
Usage:
|
||||||
zrok admin create org-member <accountEmail> <organizationToken> [flags]
|
zrok admin create org-member <organizationToken> <accountEmail> [flags]
|
||||||
|
|
||||||
Aliases:
|
Aliases:
|
||||||
org-member, member
|
org-member, member
|
||||||
@ -81,7 +81,7 @@ Global Flags:
|
|||||||
Like this:
|
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
|
[ 0.006] INFO main.(*adminCreateOrgMemberCommand).run: added 'michael.quigley@netfoundry.io' to organization 'gK1XRvthq7ci
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user