Install Homebrew package with all available options

Is there a way to install a package and include all --with* options instead of typing all of them individually at the CLI?

To avoid:

brew install ffmpeg --with-chromaprint --with-fdk-aac ...

Solution 1:

Disclaimer: I'm not so familiar with grep. Smarter solutions are welcome.


You can list all options with this command.

brew options target_formula

And you can get all --with-* options with this.

brew options target_formula | grep 'with-'

So you can install a formula with all --with-* options by this.

brew install target_formula `brew options target_formula | grep 'with-'`

Note that some formula, especially in unofficial tap, can have old options not prefixed with --with- or --without.



EDIT: If you want to exclude specific option, for example --with-zimg, you can do that with this.
(grep -v 'with-zimg' is fine, but grep -v 'zimg' is shorter)

brew install target_formula `brew options target_formula | grep 'with-' | grep -v 'zimg'`

Solution 2:

There is no wildcard-expansion mechanism for arguments in Homebrew, so the possibility to select all options, would depend on the implementation of each formula.

Looking at the ffmpeg formula code, each option is handled individually, so it is not possible using the current version.

You would have to modify the formula removing the conditionals in lines like:

args << "--enable-chromaprint" if build.with? "chromaprint"

Or add a global switch for all arguments; or change the logic to install all by default and make the switches for disabling options.