class GetoptLong::DSL
DSL-mode parser.
Attributes
arguments[R]
Public Class Methods
new(&block)
click to toggle source
# File lib/more/facets/getoptlong.rb, line 50 def initialize(&block) @arguments = [] instance_eval(&block) end
Public Instance Methods
flag(*opts)
click to toggle source
# File lib/more/facets/getoptlong.rb, line 55 def flag(*opts) @arguments << (opts << GetoptLong::NO_ARGUMENT) end
optional(*opts)
click to toggle source
# File lib/more/facets/getoptlong.rb, line 64 def optional(*opts) @arguments << (opts << GetoptLong::OPTIONAL_ARGUMENT) end
Also aliased as: opts
required(*opts)
click to toggle source
# File lib/more/facets/getoptlong.rb, line 59 def required(*opts) @arguments << (opts << GetoptLong::REQUIRED_ARGUMENT) end
Also aliased as: reqs