A Main instance has a Groovysh member representing the shell, and a startGroovysh() method to run an interactive shell. Subclasses should preferably extend createIO() or configure the shell via getShell prior to invoking startGroovysh. Clients may use configureAndStartGroovysh to provide the same CLI params but a different Groovysh implementation (implementing getIO() and run()). The class also has static utility methods to manipulate the static ansi state using the jAnsi library. Main CLI entry-point for groovysh.
Constructor and description |
---|
Main
(IO io) @param io: may just be new IO(), which is the default |
Main
(IO io, CompilerConfiguration configuration) @param io: may just be new IO(), which is the default |
Type Params | Return Type | Name and description |
---|---|---|
|
static void |
installAnsi() |
|
static void |
main(String[] args) create a Main instance, configures it according to CLI arguments, and starts the shell. |
|
static void |
setSystemProperty(String nameValue) |
|
static void |
setTerminalType(String type, boolean suppressColor) @param type: one of 'auto', 'unix', ('win', 'windows'), ('false', 'off', 'none') |
|
protected void |
startGroovysh(String evalString, List<String> filenames) @param evalString commands that will be executed at startup after loading files given with filenames param |
io:
- may just be new IO(), which is the default
io:
- may just be new IO(), which is the defaultcreate a Main instance, configures it according to CLI arguments, and starts the shell.
main
- must have a Groovysh member that has an IO member.
type:
- one of 'auto', 'unix', ('win', 'windows'), ('false', 'off', 'none')suppressColor
- only has effect when ansi is enabledCopyright © 2003-2021 The Apache Software Foundation. All rights reserved.