Class: MetadataCop::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/metadatacop/options.rb

Class Method Summary collapse

Class Method Details

.parse(args) ⇒ Object



5
6
7
8
9
10
# File 'lib/metadatacop/options.rb', line 5

def self.parse(args)
  options = {}

  parser(options).parse!(args)
  options
end

.parser(options) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/metadatacop/options.rb', line 12

def self.parser(options)
  OptionParser.new do |opts|
    opts.on('-t', '--type [TYPE]', 'Rules to apply') do |t|
      options[:type] = t
    end

    opts.on('-h', '--help', 'Prints this help') do
      puts opts
      exit
    end
  end
end