diff --git a/plugins/idea-not-null/src/main/java/org/vineflower/ideanotnull/IdeaNotNullPlugin.java b/plugins/idea-not-null/src/main/java/org/vineflower/ideanotnull/IdeaNotNullPlugin.java index 3d590c3de4..5bc9b8f086 100644 --- a/plugins/idea-not-null/src/main/java/org/vineflower/ideanotnull/IdeaNotNullPlugin.java +++ b/plugins/idea-not-null/src/main/java/org/vineflower/ideanotnull/IdeaNotNullPlugin.java @@ -14,6 +14,11 @@ public String id() { return "IdeaNotNull"; } + @Override + public String description() { + return "Decompiles code inserted by Intellij IDEA's @NotNull annotation."; + } + @Override public void registerJavaPasses(JavaPassRegistrar registrar) { registrar.register(JavaPassLocation.MAIN_LOOP, new NamedPass("IdeaNotNull", new IdeaNotNullPass())); diff --git a/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinPlugin.java b/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinPlugin.java index 6ce575d272..7e79998ae4 100644 --- a/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinPlugin.java +++ b/plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinPlugin.java @@ -25,6 +25,11 @@ public String id() { return "Kotlin"; } + @Override + public String description() { + return "Detects and decompiles Kotlin class files."; + } + @Override public @Nullable PluginOptions getPluginOptions() { return () -> Pair.of(KotlinOptions.class, KotlinOptions::addDefaults); diff --git a/plugins/scala/src/main/java/org/vineflower/scala/ScalaPlugin.java b/plugins/scala/src/main/java/org/vineflower/scala/ScalaPlugin.java index 39ff433204..1bddaa9fdf 100644 --- a/plugins/scala/src/main/java/org/vineflower/scala/ScalaPlugin.java +++ b/plugins/scala/src/main/java/org/vineflower/scala/ScalaPlugin.java @@ -2,9 +2,14 @@ import org.jetbrains.java.decompiler.api.plugin.Plugin; -public class ScalaPlugin implements Plugin{ +public class ScalaPlugin implements Plugin { public String id(){ return "Scala"; } + + @Override + public String description() { + return "Detects and decompiles Scala class files."; + } } diff --git a/plugins/variable-renaming/src/main/java/org/vineflower/variablerenaming/VariableRenamingPlugin.java b/plugins/variable-renaming/src/main/java/org/vineflower/variablerenaming/VariableRenamingPlugin.java index 211abeef1d..185d44990f 100644 --- a/plugins/variable-renaming/src/main/java/org/vineflower/variablerenaming/VariableRenamingPlugin.java +++ b/plugins/variable-renaming/src/main/java/org/vineflower/variablerenaming/VariableRenamingPlugin.java @@ -13,6 +13,11 @@ public String id() { return "VariableRenaming"; } + @Override + public String description() { + return "Allows automatic renaming of variables with a common naming scheme."; + } + @Override public @Nullable PluginOptions getPluginOptions() { return () -> Pair.of(VariableRenamingOptions.class, VariableRenamingOptions::addDefaults); diff --git a/src/org/jetbrains/java/decompiler/api/plugin/Plugin.java b/src/org/jetbrains/java/decompiler/api/plugin/Plugin.java index ea216b1f39..9e5e0f1785 100644 --- a/src/org/jetbrains/java/decompiler/api/plugin/Plugin.java +++ b/src/org/jetbrains/java/decompiler/api/plugin/Plugin.java @@ -15,6 +15,12 @@ public interface Plugin { */ String id(); + /** + * Short (1-2 sentence) long description of the plugin and its function. This will be presented to users when requested via terminal. + * @return a short description of the plugin + */ + String description(); + /** * Allows addition to the list of passes that will be run during Java decompilation. * diff --git a/src/org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler.java b/src/org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler.java index 3d077e5345..e7f9577cd2 100644 --- a/src/org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler.java +++ b/src/org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler.java @@ -69,10 +69,16 @@ else if (args.length > x+1) { return; } + if (Arrays.stream(args).anyMatch(arg -> arg.equals("--list-plugins"))) { + ConsoleHelp.printPlugins(); + return; + } + if (args.length < 1) { System.out.println( + "=== Vineflower Decompiler " + version() + " ===\n\n" + "Usage: java -jar vineflower.jar --