Skip to content
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

Merged
merged 8 commits into from
Jan 17, 2023

Conversation

ewanharris
Copy link
Contributor

🔧 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

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@ewanharris ewanharris requested a review from a team as a code owner January 17, 2023 09:54
docs/auth0_apis_list.md Outdated Show resolved Hide resolved
@@ -70,22 +81,38 @@ func listRolePermissionsCmd(cli *cli) *cobra.Command {
inputs.ID = args[0]
}

var list *management.PermissionList
list, err := getWithPagination(
Copy link
Contributor

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.

internal/cli/roles.go Outdated Show resolved Hide resolved
@@ -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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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!

Copy link
Contributor

@sergiught sergiught Jan 17, 2023

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?

internal/cli/apps.go Outdated Show resolved Hide resolved
@ewanharris ewanharris requested review from willvedd and sergiught and removed request for willvedd and sergiught January 17, 2023 15:42
@sergiught
Copy link
Contributor

Great first contribution 👍🏻 @ewanharris 🥳

@sergiught sergiught merged commit 5dac921 into auth0:v1 Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants