Replies: 4 comments 3 replies
-
One idea would be to have a two-phased approach, where in the 2nd phase, you parse the input that was gathered into the --compiler-arguments list. So, you would have one class with the Picocli has some support for quoted values, for cases where the quotes were not removed by the shell. Hope this is helpful. |
Beta Was this translation helpful? Give feedback.
-
Thanks for updating the test. I understand a bit better now (I hope). This is my understanding now:
Your requirements are unusual but doable. :-) Please take a look at the updated tests with the custom parameter processing: https:/remkop/picocli/blob/main/src/test/java/picocli/Issue2342.java I added an |
Beta Was this translation helpful? Give feedback.
-
Additionally, you mentioned that
Picocli has support for @-files. I believe this may be what you are looking for, please take a look. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I am using picocli to build a tool that needs to compile some Java code. That part of the process can be configured with compiler options. Looking at how other tools (such as Maven) deal with this, it's either via one entry per argument or a
String
that contains the complete list of arguments.The compiler I use requires those options to be provided one by one. After a bit of back and forth I ended up with:
This works well, but I am wondering if that's the best option. In particular, I wonder if the project has some sort of parsing for command line where single quote or double quote are used to capture an argument with space in its value. Ideally, I would like to support something like:
mytool --compiler-arguments --enable-preview -Dtest='My Value' -Danother=Another
which would parse a list with 3 items.
I am also considering adding support for a file argument and I wonder if the option I've chosen would prevent me to use that in an idiomatic fashion.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions