From 1b1e15f12722aa52894582d81d54a2bf113ffc92 Mon Sep 17 00:00:00 2001 From: Ryan Rotter Date: Sat, 29 Jun 2024 16:21:11 -0400 Subject: [PATCH] improve wording of desc search warning --- Library/Homebrew/search.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/search.rb b/Library/Homebrew/search.rb index 38bb22437ace6b..3e78204d099623 100644 --- a/Library/Homebrew/search.rb +++ b/Library/Homebrew/search.rb @@ -30,8 +30,8 @@ def self.search_descriptions(string_or_regex, args, search_type: :desc) else unofficial = Tap.all.sum { |tap| tap.official? ? 0 : tap.formula_files.size } if unofficial.positive? - opoo "#{unofficial} additional formula(e) in third party repositories were not searched. " \ - "To search all formulae repeat this search with the flag `--eval-all`." + opoo "Use `--eval-all` to search #{unofficial} additional " \ + "#{Utils.pluralize("formula", unofficial, plural: "e")} in third party taps." end descriptions = Homebrew::API::Formula.all_formulae.transform_values { |data| data["desc"] } Descriptions.search(string_or_regex, search_type, descriptions, eval_all, cache_store_hash: true).print @@ -50,10 +50,9 @@ def self.search_descriptions(string_or_regex, args, search_type: :desc) else unofficial = Tap.all.sum { |tap| tap.official? ? 0 : tap.cask_files.size } if unofficial.positive? - opoo "#{unofficial} additional cask(s) in third party repositories were not searched. " \ - "To search all casks repeat this search with the flag `--eval-all`." + opoo "Use `--eval-all` to search #{unofficial} additional " \ + "#{Utils.pluralize("cask", unofficial)} in third party taps." end - # descriptions = Homebrew::API::Cask.all_casks.transform_values { |data| data["desc"] } descriptions = Homebrew::API::Cask.all_casks.transform_values { |c| [c["name"].join(", "), c["desc"]] } Descriptions.search(string_or_regex, search_type, descriptions, eval_all, cache_store_hash: true).print end