1

I've found fzf to be a very useful utility, but for some reason it is failing me in this one particular instance.

$ brew outdated | fzf -m --tac | brew upgrade

Instead of letting me choose which items to upgrade, it displays a menu for a moment, and then proceeds to upgrade everything. I've never had it behave this way before. What am I overlooking?

Glorfindel
  • 805
  • 2
  • 10
  • 19
iconoclast
  • 9,057
  • 12
  • 56
  • 95

1 Answers1

1

You're sending the selection to stdout and pipe it over to brew upgrade, but brew upgrade does not use stdin. The command updates just everything.

You will need something like this to add the selection as arguments:

brew outdated | fzf -m --tac | xargs brew upgrade
pLumo
  • 22,231
  • 2
  • 41
  • 66
  • This solves the initial problem. It should not be used _as is_, however, since hitting escape in `fzf` will result in brew aggressively trying to upgrade everything, and `⌃C` only interrupting one thing at a time. (Very bad UX on the part of Homebrew in that case!) – iconoclast Sep 03 '18 at 21:18