class GroovyCommands
extends JlineCommandRegistry
implements CommandRegistry
Registers the Groovy-specific commands exposed by the groovysh JLine console.
| Constructor and description |
|---|
GroovyCommands(GroovyEngine engine, Supplier<Path> workDir, Printer printer, SyntaxHighlighter highlighter)Creates the Groovy-specific command registry for groovysh. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
CmdDesc |
commandDescription(List<String> args)Builds the detailed description for the selected command. |
|
List<String> |
commandInfo(String command)Returns the short help text registered for the named command. |
|
void |
console(CommandInput input)Launches the Swing Groovy console seeded with the current shell state. |
|
Object |
doc(CommandInput input)Opens configured documentation for the supplied object or type. |
|
Object |
getParser(String format, String parserName)Creates the parser implementation backing a named slurper format. |
|
Object |
grab(CommandInput input)Lists cached grapes or grabs the supplied dependency coordinates. |
|
void |
importsCommand(CommandInput input)Lists or removes import statements tracked by the shell. |
|
Object |
inspect(CommandInput input)Displays object details in the terminal or object browser. |
|
void |
load(CommandInput input)Restores saved state or loads a file into the current buffer. |
|
static void |
loadFile(GroovyEngine engine, File file, boolean merge)Replays file contents through the engine, optionally merging with existing state. |
|
void |
methodsCommand(CommandInput input)Lists or removes tracked method definitions. |
|
String |
name()Returns the display name for this command registry. |
|
void |
reset(CommandInput input)Clears the current buffer. |
|
void |
save(CommandInput input)Saves shared state or the current buffer to disk. |
|
static void |
saveFile(GroovyEngine engine, File file, boolean overwrite)Writes the current buffer to the target file. |
|
Object |
slurpcmd(CommandInput input)Reads content into _ from a file, URL, or literal value. |
|
void |
typesCommand(CommandInput input)Lists or removes tracked type declarations. |
|
void |
varsCommand(CommandInput input)Lists or removes tracked variable declarations. |
Creates the Groovy-specific command registry for groovysh.
engine - shell execution engineworkDir - supplier for the current working directoryprinter - terminal printerhighlighter - syntax highlighter used for previewsBuilds the detailed description for the selected command.
args - command arguments whose first element identifies the commandReturns the short help text registered for the named command.
command - command nameLaunches the Swing Groovy console seeded with the current shell state.
input - parsed command inputOpens configured documentation for the supplied object or type.
input - parsed command inputnullCreates the parser implementation backing a named slurper format.
format - user-facing format nameparserName - parser class nameLists cached grapes or grabs the supplied dependency coordinates.
input - parsed command inputnullLists or removes import statements tracked by the shell.
input - parsed command inputDisplays object details in the terminal or object browser.
input - parsed command inputnullRestores saved state or loads a file into the current buffer.
input - parsed command inputReplays file contents through the engine, optionally merging with existing state.
engine - shell execution enginefile - source file to loadmerge - whether existing state should be preservedLists or removes tracked method definitions.
input - parsed command inputReturns the display name for this command registry.
Clears the current buffer.
input - parsed command inputSaves shared state or the current buffer to disk.
input - parsed command inputWrites the current buffer to the target file.
engine - shell execution enginefile - target fileoverwrite - whether existing files may be replaced Reads content into _ from a file, URL, or literal value.
input - parsed command inputLists or removes tracked type declarations.
input - parsed command inputLists or removes tracked variable declarations.
input - parsed command inputCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.