class Main extends Object
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)
|
Main(IO io, CompilerConfiguration configuration)
|
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)
|
|
protected void |
startGroovysh(String evalString, List<String> filenames)
|
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-2022 The Apache Software Foundation. All rights reserved.