Class: Optitron::Dsl::CmdParserDsl

Inherits:
AbstractDsl show all
Defined in:
lib/optitron/dsl.rb

Instance Method Summary collapse

Methods inherited from AbstractDsl

#configure_with, #short_opts, #unclaimed_opts

Constructor Details

#initialize(root_dsl, command) ⇒ CmdParserDsl

Returns a new instance of CmdParserDsl.


60
61
62
63
# File 'lib/optitron/dsl.rb', line 60

def initialize(root_dsl, command)
  @root_dsl = root_dsl
  @target = command
end

Instance Method Details

#arg(name, description = nil, opts = nil) ⇒ Object


71
72
73
74
75
# File 'lib/optitron/dsl.rb', line 71

def arg(name, description = nil, opts = nil)
  a = super
  a.parent_cmd = @target
  a
end

#opt(name, description = nil, opts = nil) ⇒ Object


65
66
67
68
69
# File 'lib/optitron/dsl.rb', line 65

def opt(name, description = nil, opts = nil)
  o = super
  o.parent_cmd = @target
  o
end