-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass command line arguments via file to ConsoleLauncher #1498
Comments
The implementation c-/should follow most of the features supported |
@yyoncho Have you tried using the |
@marcphilipp if you try to set env variable you will hit the command line limit again ... |
@marcphilipp yes, if this is the equivalent to passing the classpath as "--cp" console platform runner param. |
@yyoncho Yes, it should be. Could you please give that a try? |
If there is interest, I can provide a pull request to replace the current jopt-simple command line parser with picocli. That will give these benefits:
In terms of track record, Groovy uses picocli for its standalone tools and recently replaced Commons CLI with picocli in their CliBuilder DSL implementation (see https://blogs.apache.org/logging/entry/groovy-2-5-clibuilder-renewal). Please let me know if there would be interest in a PR. |
@remkop, thanks for the offer!
@marcphilipp, I think the request is for
So, if jOpt Simple doesn't support that, perhaps we should consider the proposal from @remkop. @junit-team/junit-lambda, thoughts? |
Tentatively slated for 5.3 RC1 though currently only for the sake of team discussion. |
Out of interest, what is the timeline for 5.3 RC1? |
@marcphilipp @remkop I tried it with java 8 and it failed to find main class. Just for the record, you cannot use -jar + classpath. Here it is what I tried to use.
|
@yyoncho What was in
@sbrannen I know, I was just trying to come up with a workaround. 😉
@remkop picocli does look very nice! We're shading/relocating jopt-simple so JUnit users can use a different version of it in their own applications. Would that also be possible with picocli? |
@marcphilipp Yes, Groovy and Micronaut are shading picocli in their distributions so it is certainly possible. |
@remkop Cool, in that case I don't see a reason why we shouldn't explore this option. So, feel free to submit a PR, if you feel up for it. 🙂 |
Question about the expected behaviour: In JOptSimple options are defined without specifying hyphens:
This surprised me a bit, since the JOptSimple usage help only shows the "canonical" number of dashes:
In picocli, dashes are explicit when options are defined: However, this doesn’t recognize In this version, usage help now looks like this: (https://pasteboard.co/HxwGmsa.png shows the ANSI colors)
It is possible to simply define all options with both a single dash and with two dashes:
Do you prefer to recognize all options with both a single dash and with two dashes (with a longer usage help message), or is it acceptable to reject user input that does not match the format in the current usage help message? |
I thought of a way to keep the current lenient parser behavior and still display the current usage help message. Picocli allows
The values can be merged. I’ll proceed with this for now. Let me know if you prefer one of the other possibilities I mentioned in my previous comment. |
Since we want the usage to be backward compatible, let's just go with the "hidden options" approach. |
PR #1530 for this ticket now includes documentation and passes all tests. Kindly review at your convenience. |
It would be great if this could be included in 5.3 RC1. Please let me know if there’s anything I can do to facilitate that. |
Fully agreed! I'll review #1530 today. |
* remove arity = "0..1" from disable-ansi-colors options: no need to accept a "true|false" parameter * remove single-dash -fail-if-no-tests option: recently introduced so no worries about breaking existing apps * option names attribute for --config option does not need to be an array
…colors no longer accepts a "true|false" parameter
… message and usage help instead of stacktrace
This commit introduces support for @-files (parameter files) by using the picocli command line parser instead of jopt-simple. This also gives ANSI colored usage help on supported platforms. Classes `DetailsConverter`, `ThemeConverter`, `UriConverter`, and `KeyValuePairConverter` were removed since they are not longer needed. Resolves junit-team#1498.
Issue: junit-team#1498
There is a command line argument limit on OS-es like Windows(8081). So it would be good if it is possible to pass command line arguments to
junit-platform-console-standalone
via file since the classpath might be very big.The text was updated successfully, but these errors were encountered: