-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Improve cash search #2471
Improve cash search #2471
Conversation
PR for #1189 |
Cool! I like this idea, and will test it, but note there is a merge conflict with #2461. |
Ok, i add ignore case to my PR like 2461. |
That's also great! Just be aware of a separate issue: GitHub can't smoothly merge in the pull request, because the code where you started from conflicts with what is now the current master branch. One solution is for you to pull down the current master, However, if you have never done those operations before, I can do it for you if this PR is accepted. (The conflict originated with my commit, so I am happy to fix the side effects.) |
Maybe you should help me with this process. I tried to rebase and push back to my branch improve-cask-search on Github but didn't success. Thank you |
You might have to give the |
OK, I have tested this and I think it is cool. 👍 It does have one regression, though. Previously we accepted a regular-expression argument to search, and that is documented. Since hyphens are a valid part of regular expressions, this breaks:
So I would propose we assume that an argument bounded by /slashes/ is a regexp, and continue to use the old logic in that case, like this if search_term =~ %r{^/(.*)/$}
search_regexp = $1
casks = Cask::CLI.nice_listing(Cask.all_titles.grep(/#{search_regexp}/i))
else
all_titles = Cask.all_titles
... <your new idea goes here> ...
end Then, the advanced user can still do |
All done. |
Ignore all the hyphens in cask title and search term make "brew cask search" ignore case like Homebrew#2461 restore search by regular expression feature
Ignore all the hyphens in cask title and search term