Sha256: e0a1ffdcd95246b7be7a4772d5ff14d2c2c2ca157de9a17a26aa0891db59eedb

Contents?: true

Size: 1015 Bytes

Versions: 6

Compression:

Stored size: 1015 Bytes

Contents

#!/usr/bin/env ruby
require 'optparse'
require 'absa-h2h'
require 'absa-h2h/version'

options = {}

opt_parser = OptionParser.new do |opt|
  opt.banner = "Usage: opt_parser COMMAND [OPTIONS]"
  opt.separator  ""
  opt.separator  "Commands"
  opt.separator  "     absa-h2h input <FILENAME>"
  opt.separator  "     absa-h2h output <FILENAME>"
  opt.separator  ""
  opt.separator  "Options"

  opt.on("-h","--help","help") do
    puts opt_parser
  end
  
  opt.on("-v","--version","version") do
    puts Absa::H2h::VERSION
  end
end

opt_parser.parse!

case ARGV[0]
when "input"
  file = Dir.pwd + "/" + ARGV[1]
  file_contents = File.open(file, "rb").read
  options = Absa::H2h::Transmission::Document.hash_from_s(file_contents, 'input')
  puts options.to_yaml
when "output"
  file = Dir.pwd + "/" + ARGV[1]
  file_contents = File.open(file, "rb").read
  options = Absa::H2h::Transmission::Document.hash_from_s(file_contents, 'output')
  puts options.to_yaml
else
  puts "You need to specify input or output type"
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
absa-h2h-0.1.11 bin/absa-h2h
absa-h2h-0.1.10 bin/absa-h2h
absa-h2h-0.1.9 bin/absa-h2h
absa-h2h-0.1.8 bin/absa-h2h
absa-h2h-0.1.7 bin/absa-h2h
absa-h2h-0.1.6 bin/absa-h2h