diff --git a/Library/Homebrew/cmd/desc.rb b/Library/Homebrew/cmd/desc.rb index 67d673c3fa8e92..a4e24c051e4463 100644 --- a/Library/Homebrew/cmd/desc.rb +++ b/Library/Homebrew/cmd/desc.rb @@ -47,6 +47,9 @@ def run end if search_type.present? + if !args.eval_all? && !Homebrew::EnvConfig.eval_all? && Homebrew::EnvConfig.no_install_from_api? + raise UsageError, "`brew desc --search` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!" + end query = args.named.join(" ") string_or_regex = Search.query_regexp(query) return Search.search_descriptions(string_or_regex, args, search_type:) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 4a7480119b87a1..d38f58d3f6a202 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -70,6 +70,9 @@ def run string_or_regex = Search.query_regexp(query) if args.desc? + if !args.eval_all? && !Homebrew::EnvConfig.eval_all? && Homebrew::EnvConfig.no_install_from_api? + raise UsageError, "`brew search --desc` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!" + end Search.search_descriptions(string_or_regex, args) elsif args.pull_request? search_pull_requests(query)