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 1de2edc64a1..4fb38773593 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 ef15d504fd2..169690f98a0 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 @@
import net.sourceforge.pmd.PMDVersion;
+import picocli.AutoComplete.GenerateCompletion;
import picocli.CommandLine.Command;
import picocli.CommandLine.IVersionProvider;
@@ -14,7 +15,8 @@
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 82b0125f520..74bdcd594d0 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 @@
/**
* 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 e1cf8978c34..0630b125f64 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 @@
/**
* 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 6b6332b343f..41023a59b09 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 @@
/**
* 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 114bcf64d0d..fdc5f51efac 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 @@
/**
* 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 4a657699bf7..facb2c6dc0e 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 a69cde3c66f..f33bf93348b 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 86aec7be9b3..86bb126f76b 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 @@ private Set getExpectedFileNames() {
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");