> I am proposing a bash auto-completion script for `jcmd` tool. It covers the 
> tedious part of `jcmd` tool usage - <PID|main-class> and command name.
> 
> To guess the autocompletion candidates we make intermediate calls to `jcmd` 
> and parse the output:
> * run "jcmd -l" get a list of running JVMs
> * query the list of available diagnostic commands with `jcmd <PID> help`.
> 
> The "-o nosort" is set to preserve ordering of candidates: The output from 
> autocompletion (on `TAB` key press) is structured. JVM text identification 
> <main-class|path-to-jar> immediately follows the PID of this process:
> 
> Example with 2 JVMs running:
> 
> $ jcmd -l
> 91936 jdk.jcmd/sun.tools.jcmd.JCmd -l
> 91668 install/MyApp.jar
> 91769 EventGeneratorLoop 100
> $ jcmd <TAB_key_press>
> -l                  --help              91668               install/MyApp.jar 
>   91769               EventGeneratorLoop
> 
> 
> Overall it should greatly improve QoL for `jcmd` Users.

Ivan Bereziuk has updated the pull request incrementally with two additional 
commits since the last revision:

 - copy the autocompletion script to the jdk image
 - move script in bash-completion/ folder and remove extention

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/30606/files
  - new: https://git.openjdk.org/jdk/pull/30606/files/6bf4041e..7d491849

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=30606&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30606&range=01-02

  Stats: 39 lines in 2 files changed: 39 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/30606.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30606/head:pull/30606

PR: https://git.openjdk.org/jdk/pull/30606

Reply via email to