app/data_dumper_options.rb
# This is a little more imperative than I would prefer,
# but it seems that's the way it needs to go here.
This is a little more imperative than I would prefer,
but it seems that's the way it needs to go here.
This is a little more imperative than I would prefer but it seems that ' s the way it needs to go here .
def parse_cli!(arg_list)
      options = {}
      parser  = OptionParser.new do |opts|
        VALUE_OPTIONS.each do |(short, long, message)|
          opts.on("-#{short} MANDATORY", "--#{long} MANDATORY", message) do |val|
            options[long] = val
          end
        end
        FLAG_OPTIONS.each do |(short, long, message)|
          opts.on("-#{short}", "--#{long}", message) do |val|
            options[long] = true
          end
        end
        opts.on("-F", "--format", "The format is always JSON. Deal with it.") do
          options['format'] = 'j'
        end
      end
      parser.parse!(arg_list)
      options
    end
def parse_cli! ( arg_list ) options = { } parser = OptionParser . new do | opts | VALUE_OPTIONS . each do | ( short , long , message ) | opts . on ( "-#{short} MANDATORY" , "--#{long} MANDATORY" , message ) do | val | options [ long ] = val end end FLAG_OPTIONS . each do | ( short , long , message ) | opts . on ( "-#{short}" , "--#{long}" , message ) do | val | options [ long ] = true end end opts . on ( "-F" , "--format" , "The format is always JSON. Deal with it." ) do options [ 'format' ] = 'j' end end parser . parse! ( arg_list ) options end
This is a little more imperative than I would prefer,
but it seems that's the way it needs to go here.
This is a little more imperative than I would prefer but it seems that ' s the way it needs to go here .
arg_list