-
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
DXCDT-326: align --number usage across commands #610
Conversation
@@ -70,22 +81,38 @@ func listRolePermissionsCmd(cli *cli) *cobra.Command { | |||
inputs.ID = args[0] | |||
} | |||
|
|||
var list *management.PermissionList | |||
list, err := getWithPagination( |
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.
Nit: This change it outside the purview of the PR. It's ok for now, but next time consider separating these changes.
@@ -628,6 +646,10 @@ func listMembersRolesOrganizationCmd(cli *cli) *cobra.Command { | |||
auth0 orgs roles members ls <org-id> -r role -n 100 | |||
auth0 orgs roles members ls <org-id> -r role -n 100 --json`, | |||
RunE: func(cmd *cobra.Command, args []string) error { | |||
if inputs.Number < 1 || inputs.Number > 1000 { |
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 imagine that you considered separating this into its own separate function. Was the idea here to keep the overhead low?
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 didn't consider moving this validation out, but @sergiught and I did chat about whether we could add a way to provide validation within a Flag
struct rather than have the validation logic within the command logic
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.
whether we could add a way to provide validation within a Flag struct rather than have the validation logic within the command logic
Good idea!
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.
🤔 Wdyt if we keep the current number validation in this PR to keep things simple, even tho repeated, and follow up with a PR to add a Validation
field on the Flag
struct?
01c2697
to
e893024
Compare
Co-authored-by: Sergiu Ghitea <[email protected]>
e893024
to
7854f8a
Compare
Great first contribution 👍🏻 @ewanharris 🥳 |
🔧 Changes
Aligns the usage of the
--number
flag across commands to be consistent and show the relevant description in each help screen📚 References
🔬 Testing
📝 Checklist