cmd/search: --desc depends on --eval-all, not the other way around

- When the user tried `brew search foo` with `--eval-all` or its
  envvar, it would fail with
  `Error: Invalid usage: `--eval-all` cannot be passed without `--desc`.`
- This was the wrong way around: `--desc` depends on `--eval-all`.
This commit is contained in:
Issy Long 2025-07-24 22:50:01 +01:00
parent a190b1fd42
commit e524b7dd47
No known key found for this signature in database

View File

@ -36,9 +36,9 @@ module Homebrew
description: "Search for casks." description: "Search for casks."
switch "--desc", switch "--desc",
description: "Search for formulae with a description matching <text> and casks with " \ description: "Search for formulae with a description matching <text> and casks with " \
"a name or description matching <text>." "a name or description matching <text>.",
depends_on: "--eval-all"
switch "--eval-all", switch "--eval-all",
depends_on: "--desc",
description: "Evaluate all available formulae and casks, whether installed or not, to search their " \ description: "Evaluate all available formulae and casks, whether installed or not, to search their " \
"descriptions.", "descriptions.",
env: :eval_all env: :eval_all