Use JOpt in jpackage to parse command line

XMLWordPrintable

    • Type: CSR
    • Resolution: Approved
    • Priority: P3
    • 25-pool, 26
    • Component/s: tools
    • None
    • behavioral
    • low
    • jpackage will support the same set of command-line options. Only the parser's internal implementation will change.
    • add/remove/modify command line option
    • JDK

      Summary

      Switch jpackage to use jdk.internal.joptsimple package to parse command line arguments instead of the internal implementation.

      Problem

      jpackage code was inherited from JavaFX with the custom parser of the command line arguments. jpackage supports 61 options; the parser code is not trivial. It is the perfect candidate for using the dedicated library for parsing command-line arguments. Other JDK tools use jdk.internal.joptsimple, so should jpackage.

      Solution

      Use jdk.internal.joptsimple package to parse command line arguments instead of the internal implementation.

      Specification

      jpackage will recognize all existing command-line options and also recognize the "-?" option as an alias for the "--help" option.

      In addition to the existing format to set the value of an option with a value that is --<option name> <value>, jpackage will recognize the following additional formats:

      --<option name>=<value>
      -<option name> <value>
      -<option name>=<value>
      

      E.g.: to set the value of the "--dest" option to the "output" directory, they can choose one of the following formats:

      --dest output
      --dest=output
      -dest output
      -dest=output
      

      Support for these formats is provided by jdk.internal.joptsimple package.

            Assignee:
            Alexey Semenyuk
            Reporter:
            Alexey Semenyuk
            Alexander Matveev, Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: