Package: org.apache.groovy.groovysh

## [Groovy] Class Main

- org.apache.groovy.groovysh.Main

-     @SuppressWarnings(value="deprecation")
      class Main
      extends Object

  Boots and runs the interactive `groovysh` console.

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `protected static class` | `Main.ExtraConsoleCommands` | Registers the extra console commands that augment the interactive shell.

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `INTERPRETER_MODE_PREFERENCE_KEY` | Preference key that controls whether groovysh starts in interpreter mode.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Main()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `static Path` | `getUserStateDirectory()` Returns the user state directory used by groovysh for persisted files.
    `` | `static void` | `main(String[] args)` Launches groovysh as a standalone JVM process.
    `` | `static int` | `start(Map<String, ?> initialBindings, String[] args)` Programmatic entry point for embedding groovysh.
    `` | `static int` | `start(String[] args)` Programmatic entry point for embedding groovysh.

  - ### Inherited Methods Summary

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

- - ### Field Detail

    - #### public static final String INTERPRETER_MODE_PREFERENCE_KEY

      Preference key that controls whether groovysh starts in interpreter mode.

  - ### Constructor Detail

    - #### Main()

  - ### Method Detail

    - #### static Path getUserStateDirectory()

      Returns the user state directory used by groovysh for persisted files.

      Returns:
        the user-specific state directory

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

      Launches groovysh as a standalone JVM process.

      Parameters:
        `args` - command-line arguments

    - #### static int start(Map<String, ?> initialBindings, String[] args)

      Programmatic entry point for embedding groovysh.

      Parameters:
        `args` - CLI-like arguments (same as main(String[])).
        `initialBindings` - binding variables for the GroovyEngine
      Returns:
        process exit code (0 for success)
      Since:
        6.0.0

    - #### static int start(String[] args)

      Programmatic entry point for embedding groovysh.

      Parameters:
        `args` - CLI-like arguments (same as main(String[])).
      Returns:
        process exit code (0 for success)
      Since:
        6.0.0