-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLI-62] cli command to list tenants available #162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. I left some feedback inline.
additionally, it would be nice to add tenants_test.go at this point (but not a blocker for this PR)
return cmd | ||
} | ||
|
||
func listTenantCmd(cli *cli) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "list", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest adding the ls
command alias.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, we could alias ls
all the list
commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want to create a seperate ticket for that? ls
all the list
commands. I will make the changes for this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I'll create a ticket for that
internal/cli/tenants.go
Outdated
return fmt.Errorf("Unable to load tenants due to an unexpected error: %w", err) | ||
} | ||
|
||
tenNames := make([]string, len(listTenant)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move the render logic (ln34 to ln46 here) to the display
package? most (all should) follow this approach. Besides consistency, it is going to apply common logic to display 1 vs several results, json output, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Description
add a command in internal/cli/tenants.go that lists in a table the tenants available to the user:
References
https://auth0team.atlassian.net/browse/CLI-62?atlOrigin=eyJpIjoiMTlhZjY0ZTY5NTk3NDFkMjk2NjNlZjAyMDg4M2ZlNTEiLCJwIjoiaiJ9
Testing
Checklist
master