This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new e1fbe8d7ea GROOVY-8162: Update Groovysh to JLine3 (document /slurp)
e1fbe8d7ea is described below

commit e1fbe8d7ea86dd1a212587d6cf581b2623c9ab61
Author: Paul King <[email protected]>
AuthorDate: Mon Aug 4 19:31:26 2025 +1000

    GROOVY-8162: Update Groovysh to JLine3 (document /slurp)
---
 .../src/spec/doc/assets/img/repl_slurp.png             | Bin 0 -> 364735 bytes
 subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc |  13 +++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_slurp.png 
b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_slurp.png
new file mode 100644
index 0000000000..93146ec6c1
Binary files /dev/null and 
b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_slurp.png differ
diff --git a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc 
b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
index 807968e9d3..e336a09018 100644
--- a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
+++ b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
@@ -612,6 +612,19 @@ as well as a few used for configuring various shell 
features.
 
 image:assets/img/repl_show.png[Usage of the /show command, width=60%]
 
+[[GroovyShell-slurp]]
+==== `/slurp`
+
+Slurp files to shared variables. Groovy has a bunch of slurpers for
+various formats like XML, JSON, YAML, etc. You can use those in your code
+if you like, but the `/slurp` command can be a convenience shortcut.
+It supports most of the common formats, including JSON, XML, YAML, CSV, TOML 
and property files.
+
+image:assets/img/repl_slurp.png[Usage of the /slurp command, width=75%]
+
+You can also provide an encoding. If you want more advanced control over the 
slurping,
+you can use Groovy's "Slurper" classes directly, e.g. `new 
XmlSlurper().parseText(...)`.
+
 [[GroovyShell-types]]
 ==== `/types`
 

Reply via email to