From 215dcc4c3dcccd3110f21a9397635463cfb3411c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 21 Jan 2024 13:56:34 +0100 Subject: [PATCH] import command stub --- .../decompiler/flash/cli/commands/Import.java | 80 +++++++++++++++++++ .../decompiler/flash/cli/commands/Main.java | 3 +- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Import.java diff --git a/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Import.java b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Import.java new file mode 100644 index 000000000..0ec36fd85 --- /dev/null +++ b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Import.java @@ -0,0 +1,80 @@ +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.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 = "import", + mixinStandardHelpOptions = true, + versionProvider = VersionProvider.class, + header = "Bulk import items to the SWF", + 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 import sound input.swf output.swf c:/sounds/", + "ffdec-cli import --update-bounds shape input.swf output.swf c:/shapes/", + "ffdec-cli import symbolclass input.swf output.swf c:/data/sc.csv", + }, + sortSynopsis = false +) +public class Import implements Runnable { + + + @Parameters( + index = "0", + paramLabel = "", + description = { + "Item kind to import.", + "@|bold Enum values|@: ${COMPLETION-CANDIDATES}" + } + ) + ImportObject itemKind; + + @Parameters( + index = "1", + paramLabel = "IN_FILE", + description = "Input file" + ) + String inFile; + + @Parameters( + index = "2", + paramLabel = "OUT_FILE", + description = "Output file" + ) + String outFile; + + @Parameters( + index = "3", + paramLabel = "DATA_DIR", + description = "Data directory containing imported items. For symbolclass item kind, it is a file instead of directory." + ) + String dataDirectory; + + @Option( + names = "--update-bounds", + description = "For shape import: Update shape bounds (no fill)", + order = 1 + ) + boolean updateShapeBounds; + + @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 38f8215ea..1c6cf251e 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 @@ -51,7 +51,8 @@ import picocli.CommandLine.ScopeType; ReplaceCharacter.class, ReplaceCharacterId.class, Remove.class, - RemoveCharacter.class + RemoveCharacter.class, + Import.class }, descriptionHeading = "%n@|bold,underline Description|@:%n", optionListHeading = "%n@|bold,underline Options|@:%n",