Method: Clio::Commandable.parse_equal
- Defined in:
- lib/clio/commandable.rb
.parse_equal(obj, opt, argv) ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/clio/commandable.rb', line 113 def parse_equal(obj, opt, argv) if md = /^[-]*(.*?)=(.*?)$/.match(opt) x, v = md[1], md[2] else raise ArgumentError, "#{x}" end if obj.respond_to?("#{x}=") # TODO: to_b if 'true' or 'false' ? obj.send("#{x}=",v) else obj.option_missing(x, v) # argv? end end |