Sha256: de29fd7313ecc6d32ccd8f89a16c23164e3008d24e82b86f4417330b281478bc

Contents?: true

Size: 1023 Bytes

Versions: 48

Compression:

Stored size: 1023 Bytes

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'pathname'

$: << File.expand_path('../../lib', Pathname.new(__FILE__).realpath)

require 'junoser'


command = nil
opts = OptionParser.new do |opts|
  opts.banner = 'junoser: an juniper configuration parser'
  opts.define_head 'Usage: junoser [options] [path]'
  opts.separator ''
  opts.separator 'Options:'

  opts.on '-c', '--check', 'Verify syntax' do
    command = :check
  end

  opts.on '-d', '--display-set', 'Translate to "display set" form' do
    command = :display_set
  end

  opts.on '-s', '--structured', 'Translate to structured form' do
    command = :struct
  end

  opts.on_tail '-h', '--help', 'Show this message' do
    puts opts
    exit
  end

  opts.on_tail '-v', '--version', 'Show version' do
    puts Junoser::VERSION
    exit
  end
end
opts.parse!

case command
when :check
  abort unless Junoser::Cli.commit_check($<)
when :display_set
  puts Junoser::Cli.display_set($<)
when :struct
  puts Junoser::Cli.struct($<)
else
  puts opts
  abort
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
junoser-0.3.9 exe/junoser
junoser-0.3.8 exe/junoser
junoser-0.3.7 exe/junoser
junoser-0.3.6 exe/junoser
junoser-0.3.5 exe/junoser
junoser-0.3.4 exe/junoser
junoser-0.3.3 exe/junoser
junoser-0.3.2 exe/junoser
junoser-0.3.1 exe/junoser
junoser-0.3.0 exe/junoser
junoser-0.2.13 exe/junoser
junoser-0.2.12 exe/junoser
junoser-0.2.11 exe/junoser
junoser-0.2.10 exe/junoser
junoser-0.2.9 exe/junoser
junoser-0.2.8 exe/junoser
junoser-0.2.7 exe/junoser
junoser-0.2.6 exe/junoser
junoser-0.2.5 exe/junoser
junoser-0.2.4 exe/junoser