Permalink
Browse files

support :quiet option

Change-Id: Iae7698ccc0e45a4e331c05c8221bb4d2a24de765
  • Loading branch information...
1 parent 823a23d commit 8a1827331bf92ca732a2782245e908768f7c693c Alex Suraci committed Oct 20, 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 8a18273

Please sign in to comment.