diff options
| author | Andre Arko | 2009-09-17 16:06:56 -0700 |
|---|---|---|
| committer | Max Howell | 2009-09-29 23:34:16 +0100 |
| commit | 195e75c1b2c19c58fd62f6622833b1740987fcd1 (patch) | |
| tree | 5ebd976c8175a16233a975c2b481086f68f2b3cb /bin | |
| parent | b9033700b69d505155ffc61a6b5f115fd22c22ab (diff) | |
| download | brew-195e75c1b2c19c58fd62f6622833b1740987fcd1.tar.bz2 | |
Search by substring unless term is inside /../
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/brew | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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? |
