Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8191477

Streamline help flags of tools in jdk.

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 11
    • Component/s: tools
    • Labels:
      None
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Hide
      Only new flags should be added, none removed. If a flag is removed, there should be some output indicating how to get help. If so, users should get along fine.

      As displaying the usage is not a common use case, changing the return value should not break anything.
      Show
      Only new flags should be added, none removed. If a flag is removed, there should be some output indicating how to get help. If so, users should get along fine. As displaying the usage is not a common use case, changing the return value should not break anything.
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      JDK

      Description

      Summary

      All tools should support the same set of help flags to display the usage message. Given the proper flag, the tool should display the usage message and terminate gracefully.

      Problem

      The flags to be used to display the usage message must be known in mind, or guessed by the user (as he can not read the usage before displaying it).

      So supporting intuitive and consistent help flags is desired.

      Currently, the various tools delivered with the jdk all use different help flags and behave differently.

      Solution

      Address inconsistencies so that all tools support --help for help flags, and -h as shortcut. As several tools already support -? (common on Microsoft Windows) and because the help flag must be guessed, all tools should also support -?.

      Return code after printing the help message should be '0'.

      Other, existing help options (-help) should still be accepted.

      Specification

      Add support for -?, -h and --help where missing and if possible. (Flags might already be used for different purpose as -h.)

      Fix return code to be '0'.

      Assure behavior by adding a test.

      The changes in detail are listed in the following table:

      They can also be found in the most recent webrev of "8189102: All tools should support -?, -h and --help": http://cr.openjdk.java.net/~goetz/wr17/8189102-helpMessage/

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                goetz Goetz Lindenmaier
                Reporter:
                goetz Goetz Lindenmaier
                Reviewed By:
                Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: