Closed lwolfsonkin closed 6 years ago
Hi @lwolfsonkin. Thanks for the report and analysis. I'll look into this when I have some time. Let me know if you're willing to fix it yourself.
I think this is blocked now, see https://github.com/Homebrew/brew/issues/4254. brew search
just doesn't output casks and I don't see a way to list casks with this change.
@laughedelic @lwolfsonkin Considering that brew cask search
is going to be deprecated in 10 days (09/30/2018), could perhaps this commit changes things?
@peterlobster: I think theoretically it should, but when I tried to use it, it didn't work for me:
$ brew search --casks sky
==> Formulae
darksky-weather
==> Casks
endlesssky kinsky skyfonts skype β skype-for-business skypewebplugin
If it were working properly, there wouldn't be formulae there.
Also for reference:
$ brew --version
Homebrew 1.7.4-58-gbde49f5
Homebrew/homebrew-core (git revision a216b; last commit 2018-09-15)
Homebrew/homebrew-cask (git revision dc49a1; last commit 2018-09-15)
Does it work for you?
@lwolfsonkin It does...
brew search sublime --cask
==> Casks
sublime homebrew/cask-versions/sublime-text-dev
sublime-text β homebrew/cask-versions/sublime-text2
@laughedelic Maybe a short term solution would be just to disable the tab completion for brew cask search
. You shouldn't be using that anyways. That said, maybe you could up the readme to reflect the change in Homebrew.
@peterlobster: I would have to disagree with you here. My understanding of the current functionality of brew search
is that, unadorned, it returns formulae and casked, and when given the --casks
flag, it should only return casks. You were lucky in this instance because there are no forumulae containing sublime
. If you choose to search something that contains formulae and casks, such as docker
:
$brew search docker
==> Formulae
docker docker-compose docker-gen docker-machine-driver-hyperkit docker-machine-parallels
docker-clean docker-compose-completion docker-ls docker-machine-driver-vultr docker-squash
docker-cloud docker-credential-helper docker-machine docker-machine-driver-xhyve docker-swarm
docker-completion β docker-credential-helper-ecr docker-machine-completion docker-machine-nfs docker2aci
==> Casks
docker β docker-toolbox homebrew/cask-versions/docker-edge
and with the --casks
flag:
$brew search --casks docker
==> Formulae
docker docker-compose docker-gen docker-machine-driver-hyperkit docker-machine-parallels
docker-clean docker-compose-completion docker-ls docker-machine-driver-vultr docker-squash
docker-cloud docker-credential-helper docker-machine docker-machine-driver-xhyve docker-swarm
docker-completion β docker-credential-helper-ecr docker-machine-completion docker-machine-nfs docker2aci
==> Casks
docker β docker-toolbox homebrew/cask-versions/docker-edge
So, brew
does not currently seem to be working according to the new description.
UPDATE:
Sorry, I think that I just looked at the documentation, and the documentation is confusing, but does what it says:
In the search documentation, it claims that brew search
should return all local formulae, brew search --casks
should return all local casks, and brew search [--desc] (<text>|/<text>/)
will search online for all casks and formulae. So, essentially, if you provide a text input, regardless of whether --casks
is or isn't provided, it will search casks and formulae online.
@laughedelic: I'm assuming this is in contrast to how you were parsing the output of brew cask search
previously because I assume if the user typed brew cask info bl
, the completion searched brew cask search bl
to come up with completions. But now, you would just brew search --casks
and pipe to grep bl
or something along those lines.
@lwolfsonkin You are correct.
@lwolfsonkin @laughedelic You second point in your post, is a excellent idea. The normal 'brew search
I skimmed through the code, and it seems that the change required is a really simple one-liner. Just swap in brew search --casks
. I'm not at my computer right now, but that's all the change should require.
@lwolfsonkin I'm assuming you're referring to like 195.
Hi guys, thanks for the discussion and the fix from @lwolfsonkin π It seems to work as expected, although it's kind of slow (probably it was the same before), but caching could help here (see #1).
brew
was updated deprecatingbrew cask search
, causing annoying error message after every initiation of autocomplete, and the new output ofbrew search
has a separate section for normal formulae and casks.3 things should happen:
brew search
instead ofbrew cask search
brew install
we should probably update the output parsing ofbrew search
, though it seems to work fine currently.