Skip to content

Commit e1fbe8d

Browse files
committed
GROOVY-8162: Update Groovysh to JLine3 (document /slurp)
1 parent 94e92f6 commit e1fbe8d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
356 KB
Loading

subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,19 @@ as well as a few used for configuring various shell features.
612612
613613
image:assets/img/repl_show.png[Usage of the /show command, width=60%]
614614
615+
[[GroovyShell-slurp]]
616+
==== `/slurp`
617+
618+
Slurp files to shared variables. Groovy has a bunch of slurpers for
619+
various formats like XML, JSON, YAML, etc. You can use those in your code
620+
if you like, but the `/slurp` command can be a convenience shortcut.
621+
It supports most of the common formats, including JSON, XML, YAML, CSV, TOML and property files.
622+
623+
image:assets/img/repl_slurp.png[Usage of the /slurp command, width=75%]
624+
625+
You can also provide an encoding. If you want more advanced control over the slurping,
626+
you can use Groovy's "Slurper" classes directly, e.g. `new XmlSlurper().parseText(...)`.
627+
615628
[[GroovyShell-types]]
616629
==== `/types`
617630

0 commit comments

Comments
 (0)