> 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 one additional commit since the last revision: moved the script from man to conf folder ------------- Changes: - all: https://git.openjdk.org/jdk/pull/30606/files - new: https://git.openjdk.org/jdk/pull/30606/files/c7fde2af..6bf4041e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=30606&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30606&range=00-01 Stats: 0 lines in 1 file changed: 0 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
