Brew Upgrate

I regularly see some variation of this error message in my shell:

$ brew update fzf
Error: This command updates brew itself, and does not take formula names.
Use `brew upgrade fzf` instead.

🤯

Homebrew knew exactly what I was trying to do here, but instead of doing it, it took the time to say "fuck you" instead.

The underlying problem is the decision to use the exact synonyms "update" and "upgrade" to mean completely different things.1

Today this finally annoyed me enough to find a solution. As a result, I added this shell function to my dotfiles:

# Make `brew update` behave like `brew upgrade`.
brew() {
    if test "$1" = "update"; then
        command brew upgrade "${@:2}"
    else
        command brew "$@"
    fi
}

Homebrew automatically updates itself so nothing of value was lost here.

Notes

1

I'm guessing this interface was designed by the same genius who came up with the RACI matrix for project management — the guy who decided that the words "accountable" and "responsible", which mean exactly the same thing in English, are the perfect names for completely different roles.

MacPorts does a better job here. The command to update/upgrade an installed port is port upgrade portname; the command to update/upgrade MacPorts itself is port selfupdate. These commands are not easily confused.

(The language inconsistency in upgrade/selfupdate is unfortunate, but it could easily be fixed by adding the aliases upgrade/update and selfupgrade/selfupdate.)