public int complete()

in chef/commands/src/main/java/org/jclouds/karaf/chef/commands/completer/ChefApiCompleter.java [43:61]


    public int complete(String buffer, int cursor, List<String> candidates) {
        try {
            if (displayApisWithoutService) {
                for (ApiMetadata apiMetadata : Apis.contextAssignableFrom(CHEF_TOKEN)) {
                    delegate.getStrings().add(apiMetadata.getId());
                }
            } else if (chefServices != null) {
                for (ApiContext<ChefApi> ctx : chefServices) {
                    String api = ctx.getId();
                    if (Apis.withId(api) != null) {
                        delegate.getStrings().add(api);
                    }
                }
            }
        } catch (Exception ex) {
            // noop
        }
        return delegate.complete(buffer, cursor, candidates);
    }