From 81d1fa2d6f96a0a828c33b9341146c920a3f8b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 21 Jan 2024 17:17:08 +0100 Subject: [PATCH] header command stub --- .../decompiler/flash/cli/commands/Header.java | 70 +++++++++++++++++++ .../decompiler/flash/cli/commands/Main.java | 3 +- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Header.java diff --git a/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Header.java b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Header.java new file mode 100644 index 000000000..ef3720fd3 --- /dev/null +++ b/libsrc/ffdec_cli/src/com/jpexs/decompiler/flash/cli/commands/Header.java @@ -0,0 +1,70 @@ +package com.jpexs.decompiler.flash.cli.commands; + +import com.jpexs.decompiler.flash.cli.VersionProvider; +import com.jpexs.decompiler.flash.cli.commands.types.CompressionKind; +import java.awt.Point; +import java.util.List; +import java.util.Map; +import java.util.Stack; +import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.Option; +import picocli.CommandLine.Parameters; +import picocli.CommandLine.ParentCommand; + +/** + * + * @author JPEXS + */ +@Command( + name = "header", + mixinStandardHelpOptions = true, + versionProvider = VersionProvider.class, + header = "Display and manipulate SWF header values", + parameterListHeading = "%n@|bold,underline Parameters|@:%n", + synopsisHeading = "@|bold,underline Usage|@:", + footerHeading = "%n@|bold,underline Example|@:%n", + footer = { + "ffdec-cli header input.swf", + "ffdec-cli header --set gfx=true --set width=1200 --out-file=output.swf input.swf", + "ffdec-cli header --set displayrect=[0,0,800px,600px] input.swf", + } +) +public class Header implements Runnable { + + @Option( + names = "--set", + paramLabel = "=", + description = {"Set values of the SWF header.", + "@|bold Available keys|@: version\n" + + " gfx (true/false)\n" + + " displayrect ([x1,y1,x2,y2])\n" + + " width\n" + + " height\n" + + " framecount\n" + + " framerate"}, + arity = "0..*" + ) + Map setValues; + + @Option( + names = "--out-file", + description = "Output file to write modifications. If ommited, file is modified inplace." + ) + String outFile = null; + + + @Parameters( + index = "0", + paramLabel = "IN_FILE", + description = "Input file" + ) + String inFile; + + + + @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 c57b57a8f..c576b2453 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 @@ -60,7 +60,8 @@ import picocli.CommandLine.ScopeType; LinkReport.class, Swf2Swc.class, AbcMerge.class, - Swf2Exe.class + Swf2Exe.class, + Header.class }, descriptionHeading = "%n@|bold,underline Description|@:%n", optionListHeading = "%n@|bold,underline Options|@:%n",