use of commandHelp.CommandHelp in project ASCIIGenome by dariober.
the class Main method initConsole.
public static ConsoleReader initConsole() throws IOException, InvalidColourException {
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
public void run() {
// On exit turn off all formatting
System.out.print("\033[0m");
}
}));
ConsoleReader console = new ConsoleReader();
try {
// Autcomplete commands with length > x
for (CommandHelp x : CommandList.commandHelpList()) {
if (x.getName().length() > 2) {
console.addCompleter(new StringsCompleter(x.getName()));
}
}
} catch (InvalidCommandLineException e) {
e.printStackTrace();
}
console.setExpandEvents(false);
return console;
}
Aggregations