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
    def initialize(&block)
      @arguments = []
      instance_eval(&block)
    end

Public Instance methods

[Source]

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

[Source]

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

Alias for optional

reqs(*opts)

Alias for required

[Source]

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

[Validate]