aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorNikolaus Wittenstein2015-05-19 14:14:49 -0400
committerMike McQuaid2015-05-25 17:23:50 +0100
commit148cafa9cdce93487be49669f658a48379b04c54 (patch)
tree2e4ec06626ae315ea226eef7be89e5838c0c8ef7 /Library
parent5e73e68ab1da3decf078747fba1e1d905a71b0c1 (diff)
downloadbrew-148cafa9cdce93487be49669f658a48379b04c54.tar.bz2
`brew search` can take a `--desc` argument to search descriptions
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/search.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb
index 1d6d2d431..5ac9db391 100644
--- a/Library/Homebrew/cmd/search.rb
+++ b/Library/Homebrew/cmd/search.rb
@@ -20,6 +20,13 @@ module Homebrew
exec_browser "https://admin.fedoraproject.org/pkgdb/packages/%2A#{ARGV.next}%2A/"
elsif ARGV.include? '--ubuntu'
exec_browser "http://packages.ubuntu.com/search?keywords=#{ARGV.next}&searchon=names&suite=all&section=all"
+ elsif ARGV.include? '--desc'
+ query = ARGV.next
+ Formula.each do |formula|
+ if formula.desc =~ query_regexp(query)
+ puts "#{formula.name}: #{formula.desc}"
+ end
+ end
elsif ARGV.empty?
puts_columns Formula.names
elsif ARGV.first =~ HOMEBREW_TAP_FORMULA_REGEX