@Incubating
@SuppressWarnings(value=["resource", "deprecation"])
class ExtraConsoleCommands
extends JlineCommandRegistry
implements CommandRegistry
Console commands that groovysh registers in addition to the Groovy and
JLine builtin registries: /clear, /pwd, /cd,
/ls, /cat, /grep, /head, /tail,
/wc, /sort, /date, /echo and /!.
Embedders that want the same command set without copying Main
can construct this class and pass the instance to
GroovyshOptions.Builder#extraCommandRegistry(CommandRegistry)
or to SystemRegistry.setCommandRegistries. Main still
registers it by default.
| Type | Name and description |
|---|---|
static List<String> |
POSIX_COMMANDSPOSIX-style commands implemented by GroovyPosixCommands. |
| Constructor and description |
|---|
ExtraConsoleCommands(Path workDir, GroovyEngine scriptEngine, LineReader reader)Creates the auxiliary console command registry used by the shell. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
List<String> |
commandInfo(String command)Returns summary text for the specified command. |
|
Path |
currentDir()Returns the current working directory tracked by the POSIX command context. |
|
String |
name()Returns the help-group name used for the extra console commands. |
POSIX-style commands implemented by GroovyPosixCommands.
Creates the auxiliary console command registry used by the shell.
workDir - initial working directoryscriptEngine - script engine backing the shell sessionreader - active line reader Returns summary text for the specified command. The first entry is the
one-line description JLine renders beside the command in /help
and in completion candidates.
command - command name to describeReturns the current working directory tracked by the POSIX command context.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.