private String[] getNames(CommandSession session, String scopedCommand) { String command = NameScoping.getCommandNameWithoutGlobalPrefix(session, scopedCommand); String[] s = command.split(":"); if (s.length == 1) { return s; } else { return new String[] { command, s[1] }; } }
private String[] getNames(CommandSession session, String scopedCommand) { String command = NameScoping.getCommandNameWithoutGlobalPrefix(session, scopedCommand); String[] s = command.split(":"); if (s.length == 1) { return s; } else { return new String[] { command, s[1] }; } }
private String[] getNames(CommandSession session, String scopedCommand) { String command = NameScoping.getCommandNameWithoutGlobalPrefix(session, scopedCommand); String[] s = command.split(":"); if (s.length == 1) { return s; } else { return new String[] { command, s[1] }; } }
protected void printMethodList(CommandSession session, PrintStream out, SortedMap<String, String> commands) { Terminal term = (Terminal) session.get(".jline.terminal"); int termWidth = term != null ? term.getWidth() : 80; out.println(Ansi.ansi().a(Ansi.Attribute.INTENSITY_BOLD).a("COMMANDS").a(Ansi.Attribute.RESET)); ShellTable table = new ShellTable().noHeaders().separator(" ").size(termWidth); table.column(new Col("Command").maxSize(64)); table.column(new Col("Description")); for (Map.Entry<String,String> entry : commands.entrySet()) { String key = NameScoping.getCommandNameWithoutGlobalPrefix(session, entry.getKey()); table.addRow().addContent(Ansi.ansi().a(Ansi.Attribute.INTENSITY_BOLD).a(key).a(Ansi.Attribute.RESET), entry.getValue()); } table.print(out, true); }