# File lib/hammer_cli/completer.rb, line 157 def option_to_complete(cmd, line) return [nil, nil] if line.empty? if line.complete? # last word must be option and can't be flag -> we complete the value # "--option " or "--option xx " opt = find_option(cmd, line[-1]) return [opt, nil] if opt and not opt.flag? else # we complete the value in the second case # "--opt" or "--option xx" or "xx yy" opt = find_option(cmd, line[-2]) return [opt, line[-1]] if opt and not opt.flag? end return [nil, nil] end