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

Mandy Chung mchung at openjdk.org
Thu Jan 9 18:07:47 UTC 2025


On Wed, 8 Jan 2025 00:40:04 GMT, Henry Jen <henryjen at openjdk.org> wrote:

>> Improving option value handling to support passing argument value starts with "--".
>> 
>> Before the fix, in following example, --add-modules will be considered as another option for JLink instead of argument value for --add-options.
>> --add-options --add-modules=jdk.incubator.concurrent
>> --add-options=--add-modules=jdk.incubator.concurrent
>> 
>> will cause JLink to report
>> Error: no value given for --add-options
>> as --add-modules is considered another option for JLink.
>> 
>> After the fix, by using = will ensure the value is properly handled as argument value
>> --add-options=--add-modules=jdk.incubator.concurrent
>
> Henry Jen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'openjdk/master' into JDK-8303884
>  - Use opt=value format when value is starting with --
>  - Fix style
>  - add test
>  - 8303884: jlink --add-options plugin does not allow GNU style options to be provided

I like this better.    If a parameter value starts with `--`, it needs to be disambigated by using the `=` form


--add-options=--add-modules=jdk.incubator.concurrent


This is like passing VM options to tools like `javac` using a single `-J` option and it needs to use the `=` form as in `-J--<name>=<value>`.   It'd be good if this is documented, maybe `jlink --list-plugins` help page?

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

PR Comment: https://git.openjdk.org/jdk/pull/22526#issuecomment-2580947066


More information about the core-libs-dev mailing list