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.6.0 exe/junoser
junoser-0.5.6 exe/junoser
junoser-0.5.5 exe/junoser
junoser-0.5.4 exe/junoser
junoser-0.5.3 exe/junoser
junoser-0.5.2 exe/junoser
junoser-0.5.1 exe/junoser
junoser-0.5.0 exe/junoser
junoser-0.4.7 exe/junoser
junoser-0.4.6 exe/junoser
junoser-0.4.5 exe/junoser
junoser-0.4.4 exe/junoser
junoser-0.4.3 exe/junoser
junoser-0.4.2 exe/junoser
junoser-0.4.1 exe/junoser
junoser-0.4.0 exe/junoser
junoser-0.3.13 exe/junoser
junoser-0.3.12 exe/junoser
junoser-0.3.11 exe/junoser
junoser-0.3.10 exe/junoser