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