Properly handle languages and versions

- Add the candidates and converters for both objects
 - Properly validate the values and pass it to the configuration
 - `--use-version` can now be repeated to set multiple language versions
 - Revise arities of other options to avoid errors
This commit is contained in:
Juan Martín Sotuyo Dodero
2022-07-30 01:45:10 -03:00
parent 172db11114
commit 34729c28e5
2 changed files with 140 additions and 64 deletions

View File

@@ -9,8 +9,10 @@ public class PMDCLI {
public static void main(String[] args) {
new CommandLine(new PMDRootCommand()).setCaseInsensitiveEnumValuesAllowed(true)
.execute("run", "-h");
// .execute("run", "-P", "foo=bar", "-R", "foo,bar", "-R", "baz", "-d", "src/main/java", "-f", "xml");
// .execute("run", "-h");
.execute("run", "--use-version", "scala-2.11", "--use-version", "apex", "--use-version",
"ecmascript-latest", "-P", "foo=bar", "-R", "foo,bar", "-R", "baz", "-d",
"src/main/java", "-f", "xml");
}
@Command(name = "cpd", mixinStandardHelpOptions = true, description = "The Copy Paste Detector")