Main (groovy 2.4.12 API)
Date: 2017-06-21

Package: org.codehaus.groovy.tools.shell

## [Groovy] Class Main

- org.codehaus.groovy.tools.shell.Main

- 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`.

  Authors:
    Jason Dillon

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `Groovysh` | `groovysh`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Main (IO io)` @param io: may just be new IO(), which is the default

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `Groovysh` | `getGroovysh()`
    `` | `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

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Property Detail

    - #### final Groovysh groovysh

  - ### Constructor Detail

    - #### Main(IO io)

      Parameters:
        `io:` - may just be new IO(), which is the default

  - ### Method Detail

    - #### Groovysh getGroovysh()

    - #### static void installAnsi()

    - #### static void main(String[] args)

      create a Main instance, configures it according to CLI arguments, and starts the shell.

      Parameters:
        `main` - must have a Groovysh member that has an IO member.

    - #### static void setSystemProperty(String nameValue)

    - #### static void setTerminalType(String type, boolean suppressColor)

      Parameters:
        `type:` - one of 'auto', 'unix', ('win', 'windows'), ('false', 'off', 'none')
        `suppressColor` - only has effect when ansi is enabled

    - #### protected void startGroovysh(String evalString, List<String> filenames)

      Parameters:
        `evalString` - commands that will be executed at startup after loading files given with filenames param
        `filenames` - files that will be loaded at startup