CLI wrongly interprets non-existing options
@Godin is already working on this.
Since May 30, 2026.
- Dominant language
- Java
- Stars
- 4.6k
- Forks
- 1.2k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 23
Description
Execution of
java -jar jacoco-0.8.10/lib/jacococli.jar report --excludes
leads to
"--excludes" is not a valid option
as expected.
However execution of
java -jar jacoco-0.8.10/lib/jacococli.jar report --classfiles Example.class --html report --sourcefiles . --excludes=bar
unexpectedly leads to
Exception in thread "main" java.io.UnsupportedEncodingException: bar
i.e. --excludes=bar is interpreted as --encoding bar.
Execution of
java -jar jacoco-0.8.10/lib/jacococli.jar report --classfiles Example.class --html report --foo=bar
unexpectedly leads to creation of a file bar containing XML report, i.e. --foo=bar is interpreted as --xml.
Seems that this happens due to the following code in args4j
https://github.com/kohsuke/args4j/blob/args4j-site-2.0.28/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L586-L599
https://github.com/kohsuke/args4j/blob/args4j-site-2.0.28/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L481-L483
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.