Skip to content

Commit

Permalink
Merge pull request #16 from jmazzi/master
Browse files Browse the repository at this point in the history
Fixes #13 "grep: Regular expression too big"
  • Loading branch information
mperham committed Oct 6, 2011
2 parents 66d5e7b + 443baac commit 502730a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/lunchy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def status(params)
pattern = params[0]
cmd = "launchctl list"
if !verbose?
agents = "(" + plists.keys.join("|") + ")"
cmd << " | grep -i -E \"#{agents}\""
agents = plists.keys.map { |k| "-e \"#{k}\"" }.join(" ")
cmd << " | grep -i #{agents}"
end
cmd.gsub!('.','\.')
cmd << " | grep -i \"#{pattern}\"" if pattern
Expand Down

0 comments on commit 502730a

Please sign in to comment.