Permalink
Browse files

Merge "support :quiet option"

  • Loading branch information...
2 parents 03a79dd + 8a18273 commit f4dcbddc09059d1795ca6cfd5c3a91b865ce2452 Alex Suraci committed with Gerrit Code Review Oct 21, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/caldecott/client/client.rb
@@ -17,13 +17,18 @@ def self.start(opts)
log_level = opts[:log_level]
auth_token = opts[:auth_token]
+ @quiet = opts[:quiet]
+
trap("TERM") { stop }
trap("INT") { stop }
tun_url = sanitize_url(tun_url)
EM.run do
- puts "Starting local server on port #{local_port} to #{tun_url}"
+ unless @quiet
+ puts "Starting local server on port #{local_port} to #{tun_url}"
+ end
+
EM.start_server("localhost", local_port, TcpConnection) do |conn|
# avoid races between tunnel setup and incoming local data
conn.pause
@@ -67,7 +72,7 @@ def self.start(opts)
end
def self.stop
- puts "Caldecott shutting down"
+ puts "Caldecott shutting down" unless @quiet
EM.stop
end
end

0 comments on commit f4dcbdd

Please sign in to comment.