if (argIndex < 0) {
return -1;
}
final Completer comp;
// if we are beyond the end of the completors, just use the last one
if (argIndex >= completers.length) {
comp = completers[completers.length - 1];
} else {
comp = completers[argIndex];
}
// ensure that all the previous completors are successful before
// allowing this completor to pass (only if strict is true).
for (int i = 0; getStrict() && (i < argIndex); i++) {
Completer sub = completers[(i >= completers.length) ? (completers.length - 1) : i];
String[] args = list.getArguments();
String arg = ((args == null) || (i >= args.length)) ? "" : args[i];
List<String> subCandidates = new LinkedList<String>();
if (sub.complete(arg, arg.length(), subCandidates) == -1) {
return -1;
}
if (subCandidates.size() == 0) {
return -1;