lib/remote_syslog/cli.rb in remote_syslog-1.6.8 vs lib/remote_syslog/cli.rb in remote_syslog-1.6.9

- old
+ new

@@ -99,10 +99,13 @@ @agent.severity = v end opts.on("--strip-color", "Strip color codes") do @agent.strip_color = true end + opts.on("--tcp", "Connect via TCP (no TLS)") do + @agent.tcp = true + end opts.on("--tls", "Connect via TCP with TLS") do @agent.tls = true end @@ -244,19 +247,19 @@ if @agent.tls && !EventMachine.ssl? error "TLS is not supported by eventmachine installed on this system.\nThe openssl-devel/openssl-dev package must be installed before installing eventmachine." end if @no_detach - puts "Watching #{@agent.files.length} files/globs. Sending to #{@agent.destination_host}:#{@agent.destination_port} (#{@agent.tls ? 'TCP/TLS' : 'UDP'})." + puts "Watching #{@agent.files.length} files/globs. Sending to #{@agent.destination_host}:#{@agent.destination_port} (#{@agent.endpoint_mode})." @agent.run else daemon = Servolux::Daemon.new(:server => @agent, :after_fork => method(:redirect_io)) if daemon.alive? error "Already running at #{@agent.pid_file}. To run another instance, specify a different `--pid-file`.", true end - puts "Watching #{@agent.files.length} files/globs. Sending to #{@agent.destination_host}:#{@agent.destination_port} (#{@agent.tls ? 'TCP/TLS' : 'UDP'})." + puts "Watching #{@agent.files.length} files/globs. Sending to #{@agent.destination_host}:#{@agent.destination_port} (#{@agent.endpoint_mode})." daemon.startup end rescue Servolux::Daemon::StartupError => e case message = e.message[/^(Child raised error: )?(.*)$/, 2] when /#<Errno::EACCES: (.*)>$/