diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/PmdCli.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/PmdCli.java
index 1de2edc64a..4fb3877359 100644
--- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/PmdCli.java
+++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/PmdCli.java
@@ -13,9 +13,9 @@ public final class PmdCli {
private PmdCli() { }
public static void main(String[] args) {
- final int exitCode = new CommandLine(new PmdRootCommand())
- .setCaseInsensitiveEnumValuesAllowed(true)
- .execute(args);
- System.exit(exitCode);
+ final CommandLine cli = new CommandLine(new PmdRootCommand())
+ .setCaseInsensitiveEnumValuesAllowed(true);
+
+ System.exit(cli.execute(args));
}
}
diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdRootCommand.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdRootCommand.java
index ef15d504fd..169690f98a 100644
--- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdRootCommand.java
+++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/PmdRootCommand.java
@@ -6,6 +6,7 @@ package net.sourceforge.pmd.cli.commands.internal;
import net.sourceforge.pmd.PMDVersion;
+import picocli.AutoComplete.GenerateCompletion;
import picocli.CommandLine.Command;
import picocli.CommandLine.IVersionProvider;
@@ -14,7 +15,8 @@ import picocli.CommandLine.IVersionProvider;
exitCodeListHeading = "Exit Codes:%n",
exitCodeList = { "0:Successful analysis, no violations found", "1:An unexpected error occurred during execution",
"2:Usage error, please refer to the command help", "4:Successful analysis, at least 1 violation found" },
- subcommands = { PmdCommand.class, CpdCommand.class, DesignerCommand.class, CpdGuiCommand.class, TreeExportCommand.class })
+ subcommands = { PmdCommand.class, CpdCommand.class, DesignerCommand.class,
+ CpdGuiCommand.class, TreeExportCommand.class, GenerateCompletion.class })
public class PmdRootCommand {
}
diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/CpdLanguageTypeSupport.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/CpdLanguageTypeSupport.java
index 82b0125f52..74bdcd594d 100644
--- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/CpdLanguageTypeSupport.java
+++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/CpdLanguageTypeSupport.java
@@ -8,9 +8,6 @@ import net.sourceforge.pmd.lang.LanguageRegistry;
/**
* Provider of candidates / conversion support for supported CPD languages.
- *
- * Beware, the help will report this on runtime, and be accurate to available
- * modules in the classpath, but autocomplete will include all available at build time.
*/
public class CpdLanguageTypeSupport extends LanguageTypeSupport {
diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/LanguageTypeSupport.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/LanguageTypeSupport.java
index e1cf8978c3..0630b125f6 100644
--- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/LanguageTypeSupport.java
+++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/LanguageTypeSupport.java
@@ -14,9 +14,6 @@ import picocli.CommandLine.TypeConversionException;
/**
* Provider of candidates / conversion support for supported PMD/CPD languages.
- *
- *
Beware, the help will report this on runtime, and be accurate to available
- * modules in the classpath, but autocomplete will include all available at build time.
*/
public class LanguageTypeSupport implements ITypeConverter, Iterable {
diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/PmdLanguageTypeSupport.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/PmdLanguageTypeSupport.java
index 6b6332b343..41023a59b0 100644
--- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/PmdLanguageTypeSupport.java
+++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/PmdLanguageTypeSupport.java
@@ -8,9 +8,6 @@ import net.sourceforge.pmd.lang.LanguageRegistry;
/**
* Provider of candidates / conversion support for supported PMD languages.
- *
- * Beware, the help will report this on runtime, and be accurate to available
- * modules in the classpath, but autocomplete will include all available at build time.
*/
public class PmdLanguageTypeSupport extends LanguageTypeSupport {
diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/PmdLanguageVersionTypeSupport.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/PmdLanguageVersionTypeSupport.java
index 114bcf64d0..fdc5f51efa 100644
--- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/PmdLanguageVersionTypeSupport.java
+++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/typesupport/internal/PmdLanguageVersionTypeSupport.java
@@ -17,9 +17,6 @@ import picocli.CommandLine.TypeConversionException;
/**
* Provider of candidates for valid language-version combinations.
- *
- * Beware, the help will report this on runtime, and be accurate to available
- * modules in the classpath, but autocomplete will include all available at build time.
*/
public class PmdLanguageVersionTypeSupport implements ITypeConverter, Iterable {
diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml
index 4a657699bf..facb2c6dc0 100644
--- a/pmd-dist/pom.xml
+++ b/pmd-dist/pom.xml
@@ -132,14 +132,6 @@
pmd-cli
${project.version}
-
-
- net.sourceforge.pmd
- pmd-cli
- ${project.version}
- sh
- completion
-
net.sourceforge.pmd
pmd-ant
diff --git a/pmd-dist/src/main/resources/assemblies/pmd-bin.xml b/pmd-dist/src/main/resources/assemblies/pmd-bin.xml
index a69cde3c66..f33bf93348 100644
--- a/pmd-dist/src/main/resources/assemblies/pmd-bin.xml
+++ b/pmd-dist/src/main/resources/assemblies/pmd-bin.xml
@@ -67,19 +67,6 @@
-
-
- runtime
-
- net.sourceforge.pmd:pmd-cli:sh:completion:*
-
- pmd-completion.sh
- shell
- 0755
- 0644
- false
-
-
runtime
diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
index 86aec7be9b..86bb126f76 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
@@ -88,7 +88,6 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest {
result.add(basedir + "bin/pmd");
result.add(basedir + "bin/pmd.bat");
result.add(basedir + "conf/simplelogger.properties");
- result.add(basedir + "shell/pmd-completion.sh");
result.add(basedir + "lib/pmd-core-" + PMDVersion.VERSION + ".jar");
result.add(basedir + "lib/pmd-java-" + PMDVersion.VERSION + ".jar");
result.add(basedir + "sbom/pmd-" + PMDVersion.VERSION + "-cyclonedx.xml");