Class: Yoptparse::Command

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

Class Method Summary collapse

Class Method Details

Returns:

  • (String)

5
6
7
8
9
10
# File 'lib/yoptparse/command.rb', line 5

def banner
  string = ::YARD::Registry.at("#{self}#initialize").docstring
  unless string.empty?
    string
  end
end

.parse(argv) ⇒ Yoptparse::Command

Parameters:

  • argv (Array<String>)

Returns:


14
15
16
17
18
# File 'lib/yoptparse/command.rb', line 14

def parse(argv)
  option_parser, result_store = generate_option_parser_and_result_store
  option_parser.parse(argv)
  new(result_store)
end

.to_option_parserOptionParser

Returns:

  • (OptionParser)

21
22
23
# File 'lib/yoptparse/command.rb', line 21

def to_option_parser
  generate_option_parser_and_result_store.first
end