Search in sources :

Example 1 with ArgGroupSpec

use of picocli.CommandLine.Model.ArgGroupSpec in project keycloak by keycloak.

the class Help method optionSectionGroups.

@Override
public List<ArgGroupSpec> optionSectionGroups() {
    List<ArgGroupSpec> allGroupSpecs = super.optionSectionGroups();
    List<ArgGroupSpec> nonEmptyGroups = new ArrayList<>(allGroupSpecs);
    Iterator<ArgGroupSpec> argGroupSpecsIt = nonEmptyGroups.iterator();
    while (argGroupSpecsIt.hasNext()) {
        ArgGroupSpec argGroupSpec = argGroupSpecsIt.next();
        if (argGroupSpec.options().stream().anyMatch(this::isVisible)) {
            continue;
        }
        // remove groups with no options in it
        argGroupSpecsIt.remove();
    }
    return nonEmptyGroups;
}
Also used : ArgGroupSpec(picocli.CommandLine.Model.ArgGroupSpec) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 ArgGroupSpec (picocli.CommandLine.Model.ArgGroupSpec)1