Search by substring unless term is inside /../
This commit is contained in:
parent
b9033700b6
commit
195e75c1b2
@ -88,7 +88,7 @@ Usage: brew [--verbose|-v]
|
||||
Commands:
|
||||
install formula ... [--debug|-d] [--interactive|-i] [--ignore-dependencies]
|
||||
remove formula ...
|
||||
search [regex]
|
||||
search [/regex/] [substring]
|
||||
list [--brewed] [--unbrewed] [formula] ...
|
||||
link formula ...
|
||||
unlink formula ...
|
||||
|
||||
6
bin/brew
6
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?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user