}
}
} else if (last instanceof Event.Option) {
Event.Option optionEvent = (Event.Option)last;
List<Token.Literal.Word> values = optionEvent.getValues();
OptionDescriptor option = optionEvent.getParameter();
if (separator == null) {
if (values.size() == 0) {
return new SpaceCompletion();
} else if (values.size() <= option.getArity()) {
Token.Literal.Word word = optionEvent.peekLast();
return new ParameterCompletion(word.getValue(), delimiter, option, completer);
} else {
return new EmptyCompletion();
}
} else {
if (values.size() < option.getArity()) {
return new ParameterCompletion("", delimiter, option, completer);
} else {
return argument(foo, completer, delimiter);
}
}