On Tue, 25 Jun 2024 13:55:32 GMT, Sonia Zaldana Calles <szald...@openjdk.org> wrote:
>> Hi all, >> >> This PR addresses [8332124](https://bugs.openjdk.org/browse/JDK-8332124) >> enabling jcmd to accept "help" as an argument to subcommands. >> >> Testing: >> - [x] Verified running `jcmd 4711 VM.metaspace help` works along with other >> subcommands. >> - [x] Added test case passes. >> >> Thanks, >> Sonia > > Sonia Zaldana Calles 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 three additional > commits since the last revision: > > - Merge branch 'openjdk:master' into JDK-8332124 > - Adding test case for suboptions with trailing spaces and adding null > terminator to reordered command > - 8332124: Jcmd processing should accept the "help" sub option as command > argument Hi Sonia -- I think this JBS entry exists to try and help out users who go fishing for help. They are off the documented path, but we can try and do what they want. I don't think we should document this attempt to help people out (partly in case it does cause any conflicts later). We we can't help people who type "help" where there should be a filename, and we don't want to make anything incompatible or change the existing help command. So if you type jcmd PID command -help or even jcmd PID command --help ..then we could help you by showing the help text. Agreed on ignoring anything additional after jcmd PID command -help (or --help). I don't think there is a problematic inconsistency with the existing "help" command, and these new help options. Commands don't have any - prefix, so the help command doesn't. But arguments to a command can have - prefixes. It is obviously inconsistent to recognise posix-style "--help", but it's clearly a user asking for help and I have no problem with it - although do wait and see if anybody else objects. 8-) This change prohibits a DCmd from implementing a "-help" argument. That is not a problem today, we don't have any that do that (and it seems too much right now to inspect the DCmd to see if it does have a "-help" argument). BTW in your current src/hotspot/share/services/diagnosticFramework.cpp:405 it would be great to not be specific about exactly one space before "help/-help/--help". ------------- PR Comment: https://git.openjdk.org/jdk/pull/19776#issuecomment-2194346407