Skip to content

Commit 94e92f6

Browse files
committed
GROOVY-8162: Update Groovysh to JLine3 (document /ttop and set commands)
1 parent e939326 commit 94e92f6

File tree

2 files changed

+52
-6
lines changed

2 files changed

+52
-6
lines changed
409 KB
Loading

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

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,34 @@ Saves the buffer’s contents to a file.
576576
If no filename is given as an argument, the current shared variables are
577577
saved into the `.groovy/groovysh.ser` file in the user home directory.
578578
579+
[[GroovyShell-setopt]]
580+
==== `/setopt`
581+
582+
Set options.
583+
584+
----
585+
groovy> /setopt
586+
disable-event-expansion
587+
use-forward-slash
588+
insert-bracket
589+
no-empty-word-options
590+
groovy>
591+
----
592+
593+
[[GroovyShell-setvar]]
594+
==== `/setvar`
595+
596+
Set linereader variable values.
597+
598+
----
599+
groovy> /setvar
600+
history-file: /Users/paulk/.groovy/groovysh_history
601+
indentation: 2
602+
list-max: 100
603+
secondary-prompt-pattern: %M%P >
604+
groovy>
605+
----
606+
579607
[[GroovyShell-show]]
580608
==== `/show`
581609
@@ -595,6 +623,27 @@ Types can be deleted using `/types -d` (completion is available) but see also th
595623
596624
image:assets/img/repl_types2.png[Deleting types, width=85%]
597625
626+
[[GroovyShell-ttop]]
627+
==== `/ttop`
628+
629+
Display information about threads.
630+
631+
image:assets/img/repl_ttop.png[Usage of the /ttop command, width=75%]
632+
633+
Various options are available:
634+
635+
----
636+
groovy> /ttop --help
637+
ttop - display and update sorted information about threads
638+
Usage: ttop [OPTIONS]
639+
-? --help Show help
640+
-o --order=ORDER Comma separated list of sorting keys
641+
-t --stats=STATS Comma separated list of stats to display
642+
-s --seconds=SECONDS Delay between updates in seconds
643+
-m --millis=MILLIS Delay between updates in milliseconds
644+
-n --nthreads=NTHREADS Only display up to NTHREADS threads
645+
----
646+
598647
[[GroovyShell-doc]]
599648
==== `/doc`
600649
@@ -664,17 +713,14 @@ https://docs.groovy-lang.org/{groovy-full-version}/html/groovy-jdk/primitives-an
664713
NOTE: In contexts where opening a browser may not be desirable, e.g. on a CI server,
665714
this command can be disabled by setting the `groovysh.disableDocCommand` system property to `true`.
666715
667-
[[GroovyShell-set]]
668-
==== `set`
669-
670-
Set or list preferences.
671-
672716
[[GroovyShell-unalias]]
673717
==== `/unalias`
674718
719+
Allows aliases to be removed.
720+
675721
image:assets/img/repl_unalias.png[Usage of the /unalias command, width=60%]
676722
677-
Allows aliases to be removed. They will be removed from persistent storage.
723+
Removed aliases will also be removed from persistent storage.
678724
679725
[[GroovyShell-Preferences]]
680726
=== Preferences

0 commit comments

Comments
 (0)