JEP 293: Guidelines for JDK Command-Line Tool Options

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Jul 8 14:01:27 UTC 2016


On 07/07/2016 11:07 PM, Dan Smith wrote:
> A suggestion for clarifying the text: I was confused about whether "may" refers to choices that the tool developer is allowed to make, or choices that the end user is allowed to make.
>
> For example: "Options can require an argument to be provided. For a long-form options, the argument may be separated from the option name by either white space or '='."
>
> Is the idea that the tool should support '=' as an alias for white space, or that the tool choose which form it wants to support?  I'm guessing the latter, but I'm not totally confident in that guess.
>
> —Dan

It means that, as you put it, "=" is an alias for white-space, so that 
you can use either of the following forms:

     --module-path my:module:path
     --module-path=my:module:path

Although it is typically easier to use and read the whitespace form, the 
'=' form is often more convenient when using the option in context where 
whitespace has conflicting significance.  For example, contrast the 
following two ways of setting the module path of javac's runtime 
environment (OK, it's a contrived example, but you get the point)

     javac ... -J--module-path -Jmy:module:path ...
     javac ... -J--module-path=my:module:path ...

Other, more realistic, examples that would require more setup to 
illustrate, would be in situations like shell scripts where you might 
need to take the shell's rules for white space expansion into account.

-- Jon


More information about the core-libs-dev mailing list