-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: project flag accepts slug #291
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.
Nice, I just have some minor improvement suggestions 😉
cmd/cloudx/client/handler.go
Outdated
if id == uuid.Nil { | ||
return nil, errors.Errorf("No project selected! Please use the flag --project to specify one.\n") | ||
} |
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 would move this error message to the very top of this function and make the condition projectOrSlug == ""
. At this point, the proper error should be similar to no project found with slug %s, only slugs %v are known
. This makes it a lot easier for users to spot their mistakes.
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.
Thanks for the review! :)
Should the output look like this then or should we only show the closest slug?
no project found with slug romantic-kilby-g76if4751f, only slugs known are:
romantic-kilby-g76if4751e
busy-jang-bwemahrjn5
busy-black-v1msdqmms0
ecstatic-swartz-ququpvs916
peaceful-kare-ugrr1tziby
stoic-dijkstra-4x7qznhyru
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 would just print the whole list. Maybe you can use the command listing the projects instead? It should at least have a type to show projects as nice tables.
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.
Nice 👍
We should also make sure that in all flag and argument documentation is up to date.
Co-authored-by: Patrik <zepatrik@users.noreply.github.com>
Co-authored-by: Patrik <zepatrik@users.noreply.github.com>
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.
Very nice solution :) Looks good to me - @zepatrik WDYT?
This PR enables supplying slugs to
cmd subcmd project PROJECTORSLUG
/cmd ls identities PROJECTORSLUG
.Related Issue or Design Document
closes #267
closes #156
Checklist
and signed the CLA.
introduces a new feature.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got approval (please contact
security@ory.sh) from the maintainers to push
the changes.
works.
appropriate).
Further comments