-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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: enables searching pins by name #10412
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.
Thanks for submitting this! I think it's a good idea to search for the exact name matches as a first iteration. In the future, I think it could be nice to have something with regular expressions too. The code looks fine to me and thanks for adding a test.
However, it does not match exactly the idea from #10281. Below you can find some comments of suggestions of what could be changed to make it slightly more generic (using contains instead of equal).
@lidel what do you think? I'm fine either way, but I think searching for something that contains the given name could be more valuable than for exact matches only.
Co-authored-by: Henrique Dias <mail@hacdias.com>
Co-authored-by: Henrique Dias <mail@hacdias.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.
Thanks for this!
ipfs#10412 changed this to partial match, but we forgot to update --help before merge
#10412 changed to be partial match but we forgot to update --help text
Closes #10281.
This PR introduces the possibility to perform a search on pin names (case-sensitive, exact search). The command
ipfs pin ls --name "pinName"
will return all the pins labeled aspinName
.Notes:
displayNames || name != ""
is implemented to prevent redundancy in specifying the--name
option. This ensures that users can simply useipfs ls --name A
instead ofipfs ls --names --name A
.