Class ShellBuilder

java.lang.Object
org.jline.shell.ShellBuilder

public class ShellBuilder extends Object
Builder for creating Shell instances.

The builder provides a fluent API for configuring the shell:

 Shell shell = Shell.builder()
     .terminal(terminal)              // optional, auto-created if null
     .prompt("myapp> ")               // or .prompt(() -> dynamicPrompt)
     .dispatcher(dispatcher)          // optional, DefaultCommandDispatcher if null
     .groups(group1, group2)          // added to dispatcher
     .parser(parser)                  // optional, DefaultParser by default
     .historyFile(path)               // optional
     .variable(name, value)           // forwarded to LineReader
     .option(Option.X, true)          // forwarded to LineReader
     .onReaderReady((reader, dispatcher) -> { ... })// optional callback
     .build();
 
Since:
4.0
See Also: