You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2025/07/26 00:55:22 UTC
(groovy-website) branch asf-site updated: new groovysh additional examples
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 170fe62 new groovysh additional examples
170fe62 is described below
commit 170fe6287dae1d85081d5d6731a044faa578b8ac
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Jul 26 10:55:13 2025 +1000
new groovysh additional examples
---
site/src/site/releasenotes/groovy-5.0.adoc | 48 +++++++++++++++++++++++++
site/src/site/releasenotes/img/NewReplGame.png | Bin 0 -> 1013047 bytes
2 files changed, 48 insertions(+)
diff --git a/site/src/site/releasenotes/groovy-5.0.adoc b/site/src/site/releasenotes/groovy-5.0.adoc
index f49b694..caa4abe 100644
--- a/site/src/site/releasenotes/groovy-5.0.adoc
+++ b/site/src/site/releasenotes/groovy-5.0.adoc
@@ -773,8 +773,56 @@ assert BitSet.valueOf(21) == fortyTwo >> 1
The `groovysh` command-line repl has been migrated to JLine3 and has many improvements.
+Here is an example showing /slurp and /prnt while processing data involving Whiskey flavors:
+
image:img/NewRepl.png[New Groovysh Repl, width=800]
+The available commands are:
+
+[source,properties]
+----
+groovy> /help
+ /! execute shell command
+ /alias create command alias
+ /classloader display/manage Groovy classLoader data
+ /clear clear terminal
+ /colors view 256-color table and ANSI-styles
+ /console launch Groovy console
+ /del delete console variables, methods, classes and imports
+ /doc open document on browser
+ /echo echos a value
+ /grab add maven repository dependencies to classpath
+ /highlighter manage nanorc theme system
+ /history list history of commands
+ /imports show/delete import statements
+ /inspect display/browse object info on terminal/object browser
+ /keymap manipulate keymaps
+ /less file pager
+ /load load state/a file into the buffer
+ /methods show/delete methods
+ /nano edit files
+ /pipe create/delete pipe operator
+ /prnt print object
+ /reset clear the buffer
+ /save save state/the buffer to a file
+ /setopt set options
+ /setvar set lineReader variable value
+ /show list console variables
+ /slurp slurp file or string variable context to object
+ /ttop display and update sorted information about threads
+ /types show/delete types
+ /unalias remove command alias
+ /unsetopt unset options
+ /vars show/delete variable declarations
+ /widget manipulate widgets
+ exit exit from app/script
+ help command help
+----
+
+Here is an example of a mini RPG game showing types, methods and variable definitions:
+
+image:img/NewReplGame.png[New Groovysh Repl, width=800]
+
[[Groovy5.0-javasyntax]]
== Java compatibility improvements
diff --git a/site/src/site/releasenotes/img/NewReplGame.png b/site/src/site/releasenotes/img/NewReplGame.png
new file mode 100644
index 0000000..f747112
Binary files /dev/null and b/site/src/site/releasenotes/img/NewReplGame.png differ