lib/json2/option.rb
# Creates a new Option instance.
Creates a new Option instance.
Creates a new Option instance .
def parse(opts)
      opts.on('-w', '--without-header', 'Output csv without a header') do
        @options[:without_header] = true
      end
      opts.on('-p', '--path PATH', 'Extract only this path') do |arg|
        @options[:with_path] = true
        @options[:path] = arg
      end
      opts.on('-v', '--version', 'Print version number and exit') do
        @options[:version] = true
      end
      opts.on('-h', '--help', 'Display this screen') do
        puts opts
        exit
      end
    end
def parse ( opts ) opts . on ( '-w' , '--without-header' , 'Output csv without a header' ) do @options [ :without_header ] = true end opts . on ( '-p' , '--path PATH' , 'Extract only this path' ) do | arg | @options [ :with_path ] = true @options [ :path ] = arg end opts . on ( '-v' , '--version' , 'Print version number and exit' ) do @options [ :version ] = true end opts . on ( '-h' , '--help' , 'Display this screen' ) do puts opts exit end end
Creates a new Option instance.
Creates a new Option instance .
opts