Merge pull request #11767 from hyuraku/search_desc_by_formula-or-cask
repair to apply `--formula` and `--cask` options to `brew search --desc`
This commit is contained in:
commit
2f369efba7
@ -78,7 +78,7 @@ module Homebrew
|
||||
string_or_regex = query_regexp(query)
|
||||
|
||||
if args.desc?
|
||||
search_descriptions(string_or_regex)
|
||||
search_descriptions(string_or_regex, args)
|
||||
elsif args.pull_request?
|
||||
only = if args.open? && !args.closed?
|
||||
"open"
|
||||
|
||||
@ -7,11 +7,13 @@ require "cask/cask_loader"
|
||||
module Homebrew
|
||||
module Search
|
||||
module Extension
|
||||
def search_descriptions(string_or_regex)
|
||||
def search_descriptions(string_or_regex, args)
|
||||
super
|
||||
|
||||
puts
|
||||
|
||||
return if args.formula?
|
||||
|
||||
ohai "Casks"
|
||||
Cask::Cask.to_a.extend(Searchable)
|
||||
.search(string_or_regex, &:name)
|
||||
|
||||
@ -19,7 +19,9 @@ module Homebrew
|
||||
raise "#{query} is not a valid regex."
|
||||
end
|
||||
|
||||
def search_descriptions(string_or_regex)
|
||||
def search_descriptions(string_or_regex, args)
|
||||
return if args.cask?
|
||||
|
||||
ohai "Formulae"
|
||||
CacheStoreDatabase.use(:descriptions) do |db|
|
||||
cache_store = DescriptionCacheStore.new(db)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user