Class: KablameOptions
- Inherits:
-
Object
- Object
- KablameOptions
- Defined in:
- lib/kablame_options.rb
Class Method Summary collapse
Instance Method Summary collapse
- #format_parse(args) ⇒ Object
-
#initialize(type) ⇒ KablameOptions
constructor
A new instance of KablameOptions.
- #opts ⇒ Object
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
.print_usage(type) ⇒ Object
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 |
#opts ⇒ Object
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. = "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 |