Add tests for completion continuation

This commit is contained in:
Eric Bottard
2014-02-17 16:57:25 +01:00
parent d11cae8ab2
commit e5adb8bc06
2 changed files with 59 additions and 5 deletions

View File

@@ -783,15 +783,18 @@ public class SimpleParser implements Parser {
for (String key : option.key()) {
if (key.equals(lastOptionKey)) {
List<Completion> allValues = new ArrayList<Completion>();
String suffix = " ";
// We'll append the closing delimiter to proposals
String suffix = "" + tokenizer.getLastValueDelimiter();
if (!suffix.endsWith(" ")) {
suffix += " ";
}
// Let's use a Converter if one is available
for (Converter<?> candidate : converters) {
if (candidate.supports(parameterType, option.optionContext())) {
// Found a usable converter
boolean addSpace = candidate.getAllPossibleValues(allValues, parameterType,
boolean allComplete = candidate.getAllPossibleValues(allValues, parameterType,
lastOptionValue, option.optionContext(), methodTarget);
if (!addSpace) {
if (!allComplete) {
suffix = "";
}
break;