aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAndre Arko2009-09-17 16:06:56 -0700
committerMax Howell2009-09-29 23:34:16 +0100
commit195e75c1b2c19c58fd62f6622833b1740987fcd1 (patch)
tree5ebd976c8175a16233a975c2b481086f68f2b3cb /bin
parentb9033700b69d505155ffc61a6b5f115fd22c22ab (diff)
downloadbrew-195e75c1b2c19c58fd62f6622833b1740987fcd1.tar.bz2
Search by substring unless term is inside /../
Diffstat (limited to 'bin')
-rwxr-xr-xbin/brew6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/brew b/bin/brew
index 24939a019..b3a1a3c82 100755
--- a/bin/brew
+++ b/bin/brew
@@ -52,7 +52,11 @@ begin
when 'search', '-S'
formulae = (HOMEBREW_PREFIX+'Library'+'Formula').children.sort.map{|f| f.basename('.rb') }
- puts_columns formulae.grep(Regexp.new(ARGV.first || ''))
+ if ARGV.first =~ /^\/(.*)\/$/
+ puts_columns formulae.grep(Regexp.new($1))
+ else
+ puts_columns formulae.grep(/.*#{ARGV.first}.*/)
+ end
when 'edit'
if ARGV.named_empty?