Class GetoptLong::DSL
In: lib/more/facets/getoptlong.rb
Parent: Object

DSL-mode parser.

Methods

flag   new   optional   opts   reqs   required  

Attributes

arguments  [R] 

Public Class methods

[Source]

    # File lib/more/facets/getoptlong.rb, line 50
50:     def initialize(&block)
51:       @arguments = []
52:       instance_eval(&block)
53:     end

Public Instance methods

[Source]

    # File lib/more/facets/getoptlong.rb, line 55
55:     def flag(*opts)
56:       @arguments << (opts << GetoptLong::NO_ARGUMENT)
57:     end

[Source]

    # File lib/more/facets/getoptlong.rb, line 64
64:     def optional(*opts)
65:       @arguments << (opts << GetoptLong::OPTIONAL_ARGUMENT)
66:     end
opts(*opts)

Alias for optional

reqs(*opts)

Alias for required

[Source]

    # File lib/more/facets/getoptlong.rb, line 59
59:     def required(*opts)
60:       @arguments << (opts <<  GetoptLong::REQUIRED_ARGUMENT)
61:     end

[Validate]