@Test public void testRun() throws Exception { Shell shell = new Shell(); shell.register(new ExitCommand(shell)); shell.register(new HelpCommand(shell)); HintCommand command = new HintCommand(shell); command.run(new Line("hint")); }
@Override public void run(Line line) throws Exception { try { shell.console().reader().printColumns(shell.commands().keySet()); shell.console().reader().flush(); } catch (IOException e) { e.printStackTrace(new PrintWriter(shell.console().reader().getOutput())); } }
HintCommand implements Command { @Override public void run(Line line) throws Exception { try { shell.console().reader().printColumns(shell.commands().keySet()); shell.console().reader().flush(); } catch (IOException e) { e.printStackTrace(new PrintWriter(shell.console().reader().getOutput())); } } }
HintCommand implements Command { @Override public void run(Line line) throws Exception { try { shell.console().reader().printColumns(shell.commands().keySet()); shell.console().reader().flush(); } catch (IOException e) { e.printStackTrace(new PrintWriter(shell.console().reader().getOutput())); } } HintCommand(Shell shell); }
HintCommand implements Command { @Override public void run(Line line) throws Exception { try { shell.console().reader().printColumns(shell.commands().keySet()); shell.console().reader().flush(); } catch (IOException e) { e.printStackTrace(new PrintWriter(shell.console().reader().getOutput())); } } HintCommand(Shell shell); @Override String name(); @Override Usage usage(); @Override void run(Line line); }
HintCommand implements Command { @Override public void run(Line line) throws Exception { try { shell.console().reader().printColumns(shell.commands().keySet()); shell.console().reader().flush(); } catch (IOException e) { e.printStackTrace(new PrintWriter(shell.console().reader().getOutput())); } } HintCommand(Shell shell); @Override String name(); @Override Usage usage(); @Override void run(Line line);  }