Package org.jline.shell.impl
Class DefaultScriptRunner
java.lang.Object
org.jline.shell.impl.DefaultScriptRunner
- All Implemented Interfaces:
ScriptRunner
Default implementation of
ScriptRunner that reads a script file
line by line and executes each line through the dispatcher.
Features:
- Skips blank lines and lines starting with
#(comments) - Supports
\line continuation (backslash at end of line joins with the next line) - Each complete line is fed to
CommandDispatcher.execute(String)
- Since:
- 4.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(Path script, CommandSession session, CommandDispatcher dispatcher) Executes a script file.
-
Constructor Details
-
DefaultScriptRunner
public DefaultScriptRunner()Creates a new DefaultScriptRunner.
-
-
Method Details
-
execute
public void execute(Path script, CommandSession session, CommandDispatcher dispatcher) throws Exception Description copied from interface:ScriptRunnerExecutes a script file.- Specified by:
executein interfaceScriptRunner- Parameters:
script- the path to the script filesession- the current command sessiondispatcher- the command dispatcher to execute lines through- Throws:
Exception- if script execution fails
-