Class: KablameOptions

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ KablameOptions

Returns a new instance of KablameOptions.



19
20
21
# File 'lib/kablame_options.rb', line 19

def initialize(type)
  @type = type
end

Class Method Details



28
29
30
# File 'lib/kablame_options.rb', line 28

def self.print_usage(type)
  puts self.new(type).opts
end

Instance Method Details

#format_parse(args) ⇒ Object



23
24
25
26
# File 'lib/kablame_options.rb', line 23

def format_parse(args)
  opts.parse!(args)
  @formats
end

#optsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/kablame_options.rb', line 5

def opts
  OptionParser.new do |opts|
    opts.banner = "Usage: #{@type}-kablame [options] <directories>"
    opts.on("-f", "--formats xml,html", Array, "List of file formats to #{@type}-kablame") do |list|
      @formats = list
    end
    
    opts.on_tail("-h", "--help", "Show this message") do
      puts opts
      exit
    end
  end
end