in commands/src/main/java/org/jclouds/karaf/commands/compute/completer/ComputeApiCompleter.java [42:60]
public int complete(String buffer, int cursor, List<String> candidates) {
try {
if (displayApisWithoutService) {
for (ApiMetadata apiMetadata : Apis.viewableAs(TypeToken.of(ComputeServiceContext.class))) {
delegate.getStrings().add(apiMetadata.getId());
}
} else if (computeServices != null) {
for (ComputeService computeService : computeServices) {
String id = computeService.getContext().unwrap().getId();
if (Apis.withId(id) != null) {
delegate.getStrings().add(computeService.getContext().unwrap().getId());
}
}
}
} catch (Exception ex) {
// noop
}
return delegate.complete(buffer, cursor, candidates);
}