From c27d7fac41fdfb71a3f6754ed13e932a65188cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 21 Jan 2024 14:39:17 +0100 Subject: [PATCH] generatedoc command stub --- .../flash/cli/commands/GenerateDoc.java | 67 +++++++++++++++++++ .../decompiler/flash/cli/commands/Main.java | 3 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/GenerateDoc.java diff --git a/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/GenerateDoc.java b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/GenerateDoc.java new file mode 100644 index 000000000..cb4ac2e21 --- /dev/null +++ b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/GenerateDoc.java @@ -0,0 +1,67 @@ +package com.jpexs.decompiler.flash.cli.commands; + +import com.jpexs.decompiler.flash.cli.VersionProvider; +import com.jpexs.decompiler.flash.cli.commands.types.CompressionKind; +import com.jpexs.decompiler.flash.cli.commands.types.DeobfuscateLevel; +import com.jpexs.decompiler.flash.cli.commands.types.DocFormat; +import com.jpexs.decompiler.flash.cli.commands.types.ImportObject; +import com.jpexs.decompiler.flash.cli.commands.types.ReplaceFormat; +import java.util.List; +import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.Option; +import picocli.CommandLine.Parameters; +import picocli.CommandLine.ParentCommand; +import picocli.CommandLine.ArgGroup; + +/** + * + * @author JPEXS + */ +@Command( + name = "generatedoc", + mixinStandardHelpOptions = true, + versionProvider = VersionProvider.class, + header = "Generate documentation", + optionListHeading = "%n@|bold,underline Options|@:%n", + parameterListHeading = "%n@|bold,underline Parameters|@:%n", + synopsisHeading = "@|bold,underline Usage|@:", + footerHeading = "%n@|bold,underline Examples|@:%n", + footer = { + "ffdec-cli generatedoc --type=as3.pcode.instructions --format=html --locale=en --out=docs.en.html", + "ffdec-cli generatedoc --type=as3.pcode.instructions --format=html --locale=cs --out=docs.cs.html", + }, + sortSynopsis = false +) +public class GenerateDoc implements Runnable { + + @Option( + names = "--type", + description = "can be currently only: as3.pcode.instructions for list of ActionScript3 AVM2 instructions", + required = true + ) + String type; + + @Option( + names = "--format", + description = "Selects output format. Currently only html is supported." + ) + DocFormat format = DocFormat.html; + + @Option( + names = "--locale", + description = "Override default locale. Sample value: en" + ) + String locale = null; + + @Option( + names = "--out", + description = "File to write docs into. If ommited, it is written to stdout." + ) + String outputFile; + + @Override + public void run() { + + } +} diff --git a/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Main.java b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Main.java index 66a377c43..03b7cdf72 100644 --- a/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Main.java +++ b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Main.java @@ -54,7 +54,8 @@ import picocli.CommandLine.ScopeType; RemoveCharacter.class, Import.class, Deobfuscate.class, - EnableDebugging.class + EnableDebugging.class, + GenerateDoc.class }, descriptionHeading = "%n@|bold,underline Description|@:%n", optionListHeading = "%n@|bold,underline Options|@:%n",