private CommandRegistry getCommandRegistry() {
return ShellContext.get().getCommandRegistry();
}
private void displayGroupCommands(final GroupNode group) throws Exception {
CommandRegistry commandRegistry=getCommandRegistry();
int maxNameLen = 20; // FIXME: Figure this out dynamically
// First display command/aliases nodes
for (Node child : group.nodes()) {
if (child instanceof CommandNode) {
try {
CommandNode node = (CommandNode) child;
String name = StringUtils.rightPad(node.getName(), maxNameLen);
Command command = commandRegistry.lookup(node.getId());
String desc = command.getDescription();
io.out.print(" ");
io.out.print(renderer.render(Renderer.encode(name, Code.BOLD)));