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

Henry Jen henryjen at openjdk.org
Thu Jan 2 18:46:47 UTC 2025


On Thu, 5 Dec 2024 17:45:32 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> --style argument still could be a real jlink argument, better check would be to see if that's a valid jlink option rather than just "--". 
>> The other alternative would be like what proposed by @YaSuenag, simply take the next token as value.
>
> 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?

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

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


More information about the core-libs-dev mailing list