Sha256: febe7d96ebf5c1a529cd29fd0aee43bb5b6329bc03aeda0cbb1d3f8ae7035cf5

Contents?: true

Size: 880 Bytes

Versions: 18

Compression:

Stored size: 880 Bytes

Contents

#!/usr/bin/env ruby

require 'pathname'

bindir = Pathname.new(__FILE__).realpath.dirname
$LOAD_PATH.unshift((bindir + '../lib').realpath)

require 'bitclust/rrdparser'
require 'optparse'

def main
  params = {"version" => "1.9.0"}
  parser = OptionParser.new
  parser.banner = "Usage: #{File.basename($0, '.*')} <file>..."
  parser.on('--param=KVPAIR', 'Set parameter by key/value pair.') {|kv|
    k, v = kv.split('=', 2)
    params[k] = v
  }
  parser.on('--help', 'Prints this message and quit.') {
    puts parser.help
    exit
  }
  begin
    parser.parse!
  rescue OptionParser::ParseError => err
    $stderr.puts err.message
    exit 1
  end

  ARGV.each do |path|
    File.open(path) {|f|
      BitClust::Preprocessor.wrap(f, params).each do |line|
        puts line
      end
    }
  end
rescue BitClust::WriterError => err
  $stderr.puts err.message
  exit 1
end

main

Version data entries

18 entries across 11 versions & 2 rubygems

Version Path
bitclust-dev-0.6.0 tools/bc-preproc.rb
bitclust-dev-0.5.5 tools/bc-preproc.rb
bitclust-dev-0.5.4 tools/bc-preproc.rb
bitclust-dev-0.5.3 tools/bc-preproc.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/bitclust-dev-0.5.1/tools/bc-preproc.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/tools/bc-preproc.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/tools/bc-preproc.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-dev-0.5.1/tools/bc-preproc.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/tools/bc-preproc.rb
bitclust-core-0.5.3 tools/bc-preproc.rb
bitclust-dev-0.5.2 tools/bc-preproc.rb
bitclust-core-0.5.2 vendor/bundle/ruby/1.9.1/gems/bitclust-dev-0.5.1/tools/bc-preproc.rb
bitclust-core-0.5.2 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/tools/bc-preproc.rb
bitclust-core-0.5.2 tools/bc-preproc.rb
bitclust-dev-0.5.1 tools/bc-preproc.rb
bitclust-core-0.5.1 tools/bc-preproc.rb
bitclust-dev-0.5.0 tools/bc-preproc.rb
bitclust-core-0.5.0 tools/bc-preproc.rb