RFR: 8303884: jlink --add-options plugin does not allow GNU style options to be provided [v3]

Henry Jen henryjen at openjdk.org
Wed Jan 8 23:23:41 UTC 2025


On Thu, 2 Jan 2025 18:43:35 GMT, Henry Jen <henryjen at openjdk.org> wrote:

>> I would expect the next token would be parsed as the value.  I suggest to explore that and see how complex it would be.
>> 
>> It seems awkward  if the following are accepted:
>> 
>> --add-options "--add-modules jdk.incubator.concurrent"
>> --add-options=--add-modules=jdk.incubator.concurrent
>> 
>> 
>> but not this:
>> 
>> --add-options "--add-modules=jdk.incubator.concurrent"
>
> I agree it's a little bit awkward, unfortunately we cannot look at the quotation as that had been decoded by shell.
> 
> Just take next token as value would be simpler, see the origin PR from @YaSuenag at https://github.com/openjdk/jdk/pull/19987.
> 
> The other alternative would be that, we can check next token against known options of jlink, and treat it as value without match. That would limited the potential ambiguous conflicts but would be even more mysterious to user?

After the update, = must be used if value is prefixed with `--`.
`--add-options=--add-modules=jdk.incubator.concurrent` will work and `--add-options="--add-modules=jdk.incubator.concurrent --module-path xx"` will work, but not -add-options "--add-modules=jdk.incubator.concurrent --module-path xx"`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22526#discussion_r1907969495


More information about the core-libs-dev mailing list