Sha256: 59a03e3c0b60039bc6abc801b706b5e5222e5e8a20818b12ce04b704a960d903

Contents?: true

Size: 935 Bytes

Versions: 2

Compression:

Stored size: 935 Bytes

Contents

#!/usr/bin/env ruby

$:.unshift File.expand_path("../../lib", __FILE__)
require 'zlogger'
require 'optparse'

# Process options
options = { :address => '127.0.0.1' }

opts = OptionParser.new do |opts|
  opts.banner = "Usage: #{$0} [options]\n\n" +
      "Tail a Zlogger daemon by subscribing to its broadcast of formatted messages"

  opts.separator ""
  opts.separator "Specific options:"

  opts.on("-c", "--connect ADDRESS",
          "TCP address to connect to, defaults to 127.0.0.1") do |ext|
    options[:address] = ext
  end

  opts.on("-p", "--port PORT", Integer, "Port number to bind to") do |n|
    options[:port] = n
  end

  opts.on_tail("-h", "--help", "Show this message") do
    puts opts
    exit
  end

  opts.on_tail("-v", "--version", "Show version") do
    puts "Zlogger version #{Zlogger::VERSION}"
    exit
  end
end

opts.parse!(ARGV)

# Create Zlogger Reader

logger = Zlogger::Reader.new(options)
logger.run

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
zlogger-0.1.0 bin/zlogtail
zlogger-0.0.2 bin/zlogtail