Search in sources :

Example 1 with InteractiveInvocationProvider

use of org.jboss.galleon.cli.terminal.InteractiveInvocationProvider in project galleon by wildfly.

the class CliMain method startInteractive.

private static void startInteractive(PmSession pmSession, CliTerminalConnection connection, boolean paging) throws Throwable {
    pmSession.setOut(connection.getOutput());
    pmSession.setErr(connection.getOutput());
    // Side effect is to resolve plugins.
    pmSession.getUniverse().resolveBuiltinUniverse();
    Settings<? extends CommandInvocation, ? extends ConverterInvocation, ? extends CompleterInvocation, ? extends ValidatorInvocation, ? extends OptionActivator, ? extends CommandActivator> settings = buildSettings(pmSession, connection, new InteractiveInvocationProvider(pmSession, paging));
    ReadlineConsole console = new ReadlineConsole(settings);
    pmSession.setAeshContext(console.context());
    console.setPrompt(pmSession.buildPrompt());
    // connection is automatically closed when exit command or Ctrl-D
    console.start();
}
Also used : ReadlineConsole(org.aesh.readline.ReadlineConsole) InteractiveInvocationProvider(org.jboss.galleon.cli.terminal.InteractiveInvocationProvider)

Aggregations

ReadlineConsole (org.aesh.readline.ReadlineConsole)1 InteractiveInvocationProvider (org.jboss.galleon.cli.terminal.InteractiveInvocationProvider)1