0

I have alias:alias br="env PATH=${PATH/\/Users\/${USER}\/\.pyenv\/shims:?/} brew"
and also compdef _brew br

But it only suggests the files and directories.
How can I get the brew options completion?

I tried compdef br=brew and compdef _brew br=brew but it doesn't work.

I'm using zsh without oh-my-zsh in mac.

bfontaine
  • 18,169
  • 13
  • 73
  • 107
  • What's the point of `env`? You can totally remove it and achieve what you want. The reason your `compdef` doesn't work is because alias is expanded before completion. Therefore, if you remove the `env`, you don't even need the `compdef`. – 4ae1e1 Oct 14 '15 at 09:59
  • When I do ```brew doctor``` I get some warning and to remove it I had to alias this I think. Completion work in other alias so I want to know way it doesn't work only in brew. – vintersnow Oct 15 '15 at 12:48
  • I think ```env``` is the problem. If I remove it and test other alias such as ```br=brew``` completion works. – vintersnow Oct 15 '15 at 12:55
  • If you have resolved the problem, you can post an answer to this yourself and then mark it accepted, to help future searchers with the same sort of question. – Dan Lowe Oct 15 '15 at 14:04
  • I meant remove env and keep the `PATH=` part. – 4ae1e1 Oct 15 '15 at 14:53

0 Answers0