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 fc68c56df9 GROOVY-8162: Update Groovysh to JLine3 (additional
documentation)
fc68c56df9 is described below
commit fc68c56df957adf52d487e7d52327f53e00fad1f
Author: Paul King <[email protected]>
AuthorDate: Tue Aug 12 21:16:54 2025 +1000
GROOVY-8162: Update Groovysh to JLine3 (additional documentation)
---
.../src/spec/doc/assets/img/repl_sort.png | Bin 0 -> 270808 bytes
.../groovy-groovysh/src/spec/doc/groovysh.adoc | 77 +++++++++++++++++++++
2 files changed, 77 insertions(+)
diff --git a/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_sort.png
b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_sort.png
new file mode 100644
index 0000000000..d4fc1f7f68
Binary files /dev/null and
b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_sort.png differ
diff --git a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
index 358ceecb47..970a30264f 100644
--- a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
+++ b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
@@ -526,6 +526,18 @@ The `/grep` command searches for patterns in files or
standard input.
image:assets/img/repl_grep.png[Echo, width=60%]
+[[GroovyShell-head]]
+==== `/head`
+
+The `/head` command displays the start of a file.
+
+[source,jshell]
+----
+groovy> /head -n2 fruit.txt
+apple
+banana
+----
+
[[GroovyShell-history]]
==== `/history`
@@ -637,6 +649,30 @@ Load a file into the buffer.
If no filename is given as an argument, the current shared variables are
loaded from the `.groovy/groovysh.ser` file in the user home directory.
+[[GroovyShell-ls]]
+==== `/ls`
+
+The `/ls` command lists files.
+
+[source,jshell]
+----
+groovy> /ls subprojects
+ groovy-dateutil groovy-swing
+.. groovy-docgenerator groovy-templates
+binary-compatibility groovy-ginq groovy-test
+groovy-all groovy-groovydoc groovy-test-junit5
+groovy-ant groovy-groovysh groovy-testng
+groovy-astbuilder groovy-jmx groovy-toml
+groovy-binary groovy-json groovy-typecheckers
+groovy-bom groovy-jsr223 groovy-xml
+groovy-cli-commons groovy-macro groovy-yaml
+groovy-cli-picocli groovy-macro-library performance
+groovy-console groovy-nio stress
+groovy-contracts groovy-servlet tests-preview
+groovy-datetime groovy-sql
+groovy>
+----
+
[[GroovyShell-nano]]
==== `/nano`
@@ -664,6 +700,17 @@ image:assets/img/repl_prnt.png[usage of the /prnt command,
width=60%]
See also the `/echo` command, which is similar but takes multiple arguments.
It also supports variable expansion but doesn't support formatting.
+[[GroovyShell-pwd]]
+==== `/pwd`
+
+The `/pwd` command prints the current working directory.
+
+[source,jshell]
+----
+groovy> /pwd
+/Users/paulk/Projects/groovy
+----
+
[[GroovyShell-reset]]
==== `/reset`
@@ -764,6 +811,25 @@ implementation, that follows the normal GPath conventions.
If you want more advanced control over the slurping,
you can use Groovy's "Slurper" classes directly, e.g. `new
XmlSlurper().parseText(...)`.
+[[GroovyShell-sort]]
+==== `/sort`
+
+The `/sort` command sorts files or standard input.
+
+image:assets/img/repl_sort.png[Deleting types, width=85%]
+
+[[GroovyShell-tail]]
+==== `/tail`
+
+The `/tail` command displays the end of a file.
+
+[source,jshell]
+----
+groovy> /tail -n2 fruit.txt
+date
+elderberry
+----
+
[[GroovyShell-types]]
==== `/types`
@@ -853,6 +919,17 @@ groovy>
See also `/setopt` to set options.
+[[GroovyShell-wc]]
+==== `/wc`
+
+The `/wc` command displays word, line, character, and byte counts.
+
+[source,jshell]
+----
+groovy> /wc LICENSE
+ 262 1754 13493 LICENSE
+----
+
[[GroovyShell-doc]]
==== `/doc`