public static Object createJLineReader(final Shell shell) throws IOException { ConsoleReader reader = new ConsoleReader(); fixCtrlC(reader); // Add a Ctrl-c listener reader.addTriggeredAction((char)3, new ActionListener() { public void actionPerformed(ActionEvent e) { shell.bye(); System.exit(0); } }); reader.setBellEnabled(false); // TODO: write a Completor specific to this that can handle the individual command arguments List<Completor> completors = new LinkedList<Completor>(); // completors.add(new SimpleCompletor(Shell.COMMANDS)); // completors.add(new ICURICompletor(shell.node)); // completors.add(new FileNameCompletor()); // reader.addCompletor(new ArgumentCompletor(completors)); reader.addCompletor(new TShellCompletor(shell)); return reader; }
public static Object createJLineReader(final Shell shell) throws IOException { ConsoleReader reader = new ConsoleReader(); fixCtrlC(reader); // Add a Ctrl-c listener reader.addTriggeredAction((char)3, new ActionListener() { public void actionPerformed(ActionEvent e) { shell.bye(); System.exit(0); } }); reader.setBellEnabled(false); // TODO: write a Completor specific to this that can handle the individual command arguments List<Completor> completors = new LinkedList<Completor>(); // completors.add(new SimpleCompletor(Shell.COMMANDS)); // completors.add(new ICURICompletor(shell.node)); // completors.add(new FileNameCompletor()); // reader.addCompletor(new ArgumentCompletor(completors)); reader.addCompletor(new TShellCompletor(shell)); return reader; }