Search in sources :

Example 1 with TextTable

use of picocli.CommandLine.Help.TextTable in project keycloak by keycloak.

the class SubCommandListRenderer method render.

@Override
public String render(Help help) {
    CommandSpec spec = help.commandSpec();
    if (spec.subcommands().isEmpty()) {
        return "";
    }
    Column commands = new Column(24, 2, Column.Overflow.SPAN);
    Column descriptions = new Column(spec.usageMessage().width() - 24, 2, Column.Overflow.WRAP);
    TextTable textTable = TextTable.forColumns(help.colorScheme(), commands, descriptions);
    textTable.setAdjustLineBreaksForWideCJKCharacters(spec.usageMessage().adjustLineBreaksForWideCJKCharacters());
    addHierarchy(spec.subcommands().values(), textTable, "");
    return textTable.toString();
}
Also used : Column(picocli.CommandLine.Help.Column) CommandSpec(picocli.CommandLine.Model.CommandSpec) TextTable(picocli.CommandLine.Help.TextTable)

Aggregations

Column (picocli.CommandLine.Help.Column)1 TextTable (picocli.CommandLine.Help.TextTable)1 CommandSpec (picocli.CommandLine.Model.CommandSpec)1