mirror of
https://github.com/openziti/zrok.git
synced 2024-12-22 14:50:55 +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(configCmd)
|
||||
rootCmd.AddCommand(modifyCmd)
|
||||
organizationCmd.AddCommand(organizationAdminCmd)
|
||||
rootCmd.AddCommand(organizationCmd)
|
||||
rootCmd.AddCommand(shareCmd)
|
||||
rootCmd.AddCommand(testCmd)
|
||||
@ -95,10 +96,15 @@ var modifyCmd = &cobra.Command{
|
||||
Short: "Modify resources",
|
||||
}
|
||||
|
||||
var organizationAdminCmd = &cobra.Command{
|
||||
Use: "admin",
|
||||
Short: "Organization admin commands",
|
||||
}
|
||||
|
||||
var organizationCmd = &cobra.Command{
|
||||
Use: "organization",
|
||||
Aliases: []string{"org"},
|
||||
Short: "Organization admin commands",
|
||||
Short: "Organization commands",
|
||||
}
|
||||
|
||||
var shareCmd = &cobra.Command{
|
||||
|
@ -11,26 +11,25 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
organizationCmd.AddCommand(newOrgAccountOverviewCommand().cmd)
|
||||
organizationAdminCmd.AddCommand(newOrgAdminOverviewCommand().cmd)
|
||||
}
|
||||
|
||||
type orgAccountOverviewCommand struct {
|
||||
type orgAdminOverviewCommand struct {
|
||||
cmd *cobra.Command
|
||||
}
|
||||
|
||||
func newOrgAccountOverviewCommand() *orgAccountOverviewCommand {
|
||||
func newOrgAdminOverviewCommand() *orgAdminOverviewCommand {
|
||||
cmd := &cobra.Command{
|
||||
Use: "account-overview <organizationToken> <accountEmail>",
|
||||
Aliases: []string{"overview"},
|
||||
Short: "Retrieve account overview for organization account (requires admin)",
|
||||
Args: cobra.ExactArgs(2),
|
||||
Use: "overview <organizationToken> <accountEmail>",
|
||||
Short: "Retrieve account overview for organization account (requires admin)",
|
||||
Args: cobra.ExactArgs(2),
|
||||
}
|
||||
command := &orgAccountOverviewCommand{cmd: cmd}
|
||||
command := &orgAdminOverviewCommand{cmd: cmd}
|
||||
cmd.Run = command.run
|
||||
return command
|
||||
}
|
||||
|
||||
func (cmd *orgAccountOverviewCommand) run(_ *cobra.Command, args []string) {
|
||||
func (cmd *orgAdminOverviewCommand) run(_ *cobra.Command, args []string) {
|
||||
root, err := environment.LoadRoot()
|
||||
if err != nil {
|
||||
if !panicInstead {
|
Loading…
Reference in New Issue
Block a user