Search in sources :

Example 1 with Settings

use of org.jboss.as.cli.impl.ReadlineConsole.Settings in project wildfly-core by wildfly.

the class CommandContextImpl method initBasicConsole.

protected void initBasicConsole(InputStream consoleInput, boolean start) throws CliInitializationException {
    // this method shouldn't be called twice during the session
    assert console == null : "the console has already been initialized";
    Settings settings = createSettings(consoleInput);
    try {
        this.console = new ReadlineConsole(settings);
    } catch (IOException ex) {
        throw new CliInitializationException(ex);
    }
    this.console.setActionCallback((line) -> {
        handleSafe(line.trim());
        if (console != null) {
            console.setPrompt(getPrompt());
        }
    });
    if (start) {
        try {
            console.start();
        } catch (IOException ex) {
            throw new CliInitializationException(ex);
        }
    }
}
Also used : CliInitializationException(org.jboss.as.cli.CliInitializationException) IOException(java.io.IOException) Settings(org.jboss.as.cli.impl.ReadlineConsole.Settings)

Aggregations

IOException (java.io.IOException)1 CliInitializationException (org.jboss.as.cli.CliInitializationException)1 Settings (org.jboss.as.cli.impl.ReadlineConsole.Settings)1