Closed jrmann100 closed 1 year ago
~Currently, "did you mean" style suggestions are only implemented for formulae.~ We do have the ability to query Github's API though and I think that was what was added in the PR you mentioned above (not sure when it was removed though). You can see how that looks by trying out brew search
.
$ brew search --cask microsoft-edg
==> Casks
microsoft-edge microsoft-excel microsoft-teams microsoft-word
IMO, we could probably just show a modified version of the brew search
results if we fail to find a cask/formula to install. We're already kind of doing this anyway.
This is what happens when we fail to find a formula to install. I don't believe that we're actually catching any cask related errors right now in the install command (Cask::CaskUnavailableError
doesn't descend from FormulaOrCaskUnavailableError
).
This is the logic for finding formula/casks in the search command. It's very similar but it also includes casks which is what you want.
It wouldn't be too hard to move #search_names
from cmd/search.rb
to search.rb
and then use it in the install command but there might be some other reason why we didn't do that originally.
I just took a second look at the search implementation for casks and it does implement the "did you mean" functionality.
IMO, we could probably just show a modified version of the
brew search
results if we fail to find a cask/formula to install. We're already kind of doing this anyway.
Seems like a good idea 👍🏻
brew doctor
outputVerification
brew doctor
output" above saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
twice and am still able to reproduce my issue.brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.brew config
outputWhat were you trying to do (and why)?
What were you trying to do: Install a cask with the wrong name.
Why were you trying to do it: Sometimes I mistype the name of a cask, or am fairly confident in guessing the name of the cask. Usually I concurrently run a
brew search
while I am typing out the install command, but this feels redundant, as the failsafe search feature is already available for formulas and appears to have once been available for casks (#3829).Why are you opening this issue:
I am opening this issue at the recommendation of @SMillerDev, from Homebrew/discussions/3986.
This issue looks similar to #3829 (please reference this issue if my explanation is unclear), but the fix implemented there does not appear to have lasted through 2022.
What happened (include all command output)?
What did you expect to happen?
I expected Brew to search for "similarly named formula" or offer a "did you mean" suggestion, as it does with formulas. Here I am omitting the
--cask
argument tobrew install
so as to demonstrate how this works with formulas:Step-by-step reproduction instructions (by running
brew
commands)