> 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 with a new target base due to a 
merge or a rebase. The incremental webrev excludes the unrelated changes 
brought in by the merge/rebase. The pull request contains eight additional 
commits since the last revision:

 - Merge branch 'master' into 8357439_bash_autocomplete_for_jcmd
 - copy the autocompletion script to the jdk image
 - move script in bash-completion/ folder and remove extention
 - moved the script from man to conf folder
 - declare functions consistently
 - more clenup
 - copyright header. minor cleanup
 - 8357439: add bash autocompletion for jcmd

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

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

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

  Stats: 8238 lines in 493 files changed: 5919 ins; 632 del; 1687 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