- It was suggested in https://github.com/Homebrew/brew/issues/ 16733 that
`brew desc <formula_or_cask>` should work like `brew info <formula_or_cask>`
and print the description of the package without needing `--eval-all`.
- Looking at the code, it seems like it's only searching that needs
`--eval-all`, so limit the check to that.
Before:
```shell
$ brew desc hello
Error: `brew desc` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!
```
After:
```shell
$ brew desc hello
hello: Program providing model for GNU coding standards and practices
$ brew desc --search hello
Error: Invalid usage: `brew desc --search` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!
$ brew desc --search --eval-all hello
==> Formulae
dsh: Dancer's shell, or distributed shell
hello: Program providing model for GNU coding standards and practices
```
- Instead use class methods.
- This is better than use it as a mixin
when only a small number of methods are
used in each class or module.
- It also allows us to conditionally
require it in `brew install`.
- Removed unused search require in descriptions.rb.
- Move cask logic back into method from extend/os and check
whether to display it based on args since formula?
is passed by default on Linux now
- Use #search_descriptions in `brew desc` instead of
duplicating logic
- Remove need for extend/os/search
We added the `--all` flag (now renamed to `--eval-all`) for various
commands for this behaviour so let's start deprecating this.
Also, introduce a `HOMEBREW_EVAL_ALL` environment variable to use the
existing, less secure, behaviour by default and avoid passing
`--eval-all` everywhere.
This makes use of both the existing interfaces and could use the
existing cache file but we'll create a new one and cleanup the old one
to avoid issues and use a more consistent name.