Method: Application.option_act

Defined in:
lib/appl.rb

.option_act(args, opt, rest) ⇒ Object



208
209
210
211
212
213
214
215
216
217
218
# File 'lib/appl.rb', line 208

def option_act args, opt, rest
  dada = find_option_act opt
  dada or raise OptionError, root::UNKNOWN % opt
  desc, arg, dfl, act = *dada
  r = [ act]
  if arg then
    p = rest.slice! 0, rest.length if rest and not rest.empty?
    r.push p||args.shift
  end
  r
end