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