mirror of
https://github.com/openziti/zrok.git
synced 2024-12-22 23:02:52 +01:00
better CLI pathing for org vs org admin commands (#537)
This commit is contained in:
parent
c3c318d529
commit
a8ec61a8f9
@ -28,6 +28,7 @@ func init() {
|
|||||||
rootCmd.AddCommand(adminCmd)
|
rootCmd.AddCommand(adminCmd)
|
||||||
rootCmd.AddCommand(configCmd)
|
rootCmd.AddCommand(configCmd)
|
||||||
rootCmd.AddCommand(modifyCmd)
|
rootCmd.AddCommand(modifyCmd)
|
||||||
|
organizationCmd.AddCommand(organizationAdminCmd)
|
||||||
rootCmd.AddCommand(organizationCmd)
|
rootCmd.AddCommand(organizationCmd)
|
||||||
rootCmd.AddCommand(shareCmd)
|
rootCmd.AddCommand(shareCmd)
|
||||||
rootCmd.AddCommand(testCmd)
|
rootCmd.AddCommand(testCmd)
|
||||||
@ -95,10 +96,15 @@ var modifyCmd = &cobra.Command{
|
|||||||
Short: "Modify resources",
|
Short: "Modify resources",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var organizationAdminCmd = &cobra.Command{
|
||||||
|
Use: "admin",
|
||||||
|
Short: "Organization admin commands",
|
||||||
|
}
|
||||||
|
|
||||||
var organizationCmd = &cobra.Command{
|
var organizationCmd = &cobra.Command{
|
||||||
Use: "organization",
|
Use: "organization",
|
||||||
Aliases: []string{"org"},
|
Aliases: []string{"org"},
|
||||||
Short: "Organization admin commands",
|
Short: "Organization commands",
|
||||||
}
|
}
|
||||||
|
|
||||||
var shareCmd = &cobra.Command{
|
var shareCmd = &cobra.Command{
|
||||||
|
@ -11,26 +11,25 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
organizationCmd.AddCommand(newOrgAccountOverviewCommand().cmd)
|
organizationAdminCmd.AddCommand(newOrgAdminOverviewCommand().cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
type orgAccountOverviewCommand struct {
|
type orgAdminOverviewCommand struct {
|
||||||
cmd *cobra.Command
|
cmd *cobra.Command
|
||||||
}
|
}
|
||||||
|
|
||||||
func newOrgAccountOverviewCommand() *orgAccountOverviewCommand {
|
func newOrgAdminOverviewCommand() *orgAdminOverviewCommand {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "account-overview <organizationToken> <accountEmail>",
|
Use: "overview <organizationToken> <accountEmail>",
|
||||||
Aliases: []string{"overview"},
|
Short: "Retrieve account overview for organization account (requires admin)",
|
||||||
Short: "Retrieve account overview for organization account (requires admin)",
|
Args: cobra.ExactArgs(2),
|
||||||
Args: cobra.ExactArgs(2),
|
|
||||||
}
|
}
|
||||||
command := &orgAccountOverviewCommand{cmd: cmd}
|
command := &orgAdminOverviewCommand{cmd: cmd}
|
||||||
cmd.Run = command.run
|
cmd.Run = command.run
|
||||||
return command
|
return command
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *orgAccountOverviewCommand) run(_ *cobra.Command, args []string) {
|
func (cmd *orgAdminOverviewCommand) run(_ *cobra.Command, args []string) {
|
||||||
root, err := environment.LoadRoot()
|
root, err := environment.LoadRoot()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !panicInstead {
|
if !panicInstead {
|
Loading…
Reference in New Issue
Block a user