From c394a64b924b45d055bdeaf34700b6d48bc7b9d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Fri, 3 May 2013 21:33:03 +0200 Subject: [PATCH] Exporting texts via command line --- .../src/com/jpexs/decompiler/flash/Main.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/Main.java b/trunk/src/com/jpexs/decompiler/flash/Main.java index f5f7982c3..c76b25792 100644 --- a/trunk/src/com/jpexs/decompiler/flash/Main.java +++ b/trunk/src/com/jpexs/decompiler/flash/Main.java @@ -428,8 +428,8 @@ public class Main { System.out.println(" ...opens SWF file with the decompiler GUI"); System.out.println(" 3) -proxy (-PXXX)"); System.out.println(" ...auto start proxy in the tray. Optional parameter -P specifies port for proxy. Defaults to 55555. "); - System.out.println(" 4) -export (as|pcode|image|shape|movie|sound|binaryData) outdirectory infile [-selectas3class class1 class2 ...]"); - System.out.println(" ...export infile sources to outdirectory as AsctionScript code (\"as\" argument) or as PCode (\"pcode\" argument), images, shapes, movies or binaryData"); + System.out.println(" 4) -export (as|pcode|image|shape|movie|sound|binaryData|text|textplain) outdirectory infile [-selectas3class class1 class2 ...]"); + System.out.println(" ...export infile sources to outdirectory as AsctionScript code (\"as\" argument) or as PCode (\"pcode\" argument), images, shapes, movies, binaryData, text with formatting or plain text."); System.out.println(" When \"as\" or \"pcode\" type specified, optional \"-selectas3class\" parameter can be passed to export only selected classes (ActionScript 3 only)"); System.out.println(" 5) -dumpSWF infile"); System.out.println(" ...dumps list of SWF tags to console"); @@ -511,8 +511,13 @@ public class Main { if (!exportFormat.toLowerCase().equals("movie")) { if (!exportFormat.toLowerCase().equals("sound")) { if (!exportFormat.toLowerCase().equals("binaryData")) { - System.err.println("Invalid export format:" + exportFormat); - badArguments(); + if (!exportFormat.toLowerCase().equals("text")) { + if (!exportFormat.toLowerCase().equals("textplain")) { + System.err.println("Invalid export format:" + exportFormat); + badArguments(); + } + } + } } } @@ -563,6 +568,12 @@ public class Main { } else if (exportFormat.equals("binaryData")) { exfile.exportBinaryData(outDir.getAbsolutePath()); exportOK = true; + } else if (exportFormat.equals("text")) { + exfile.exportTexts(outDir.getAbsolutePath(), true); + exportOK = true; + } else if (exportFormat.equals("textplain")) { + exfile.exportTexts(outDir.getAbsolutePath(), false); + exportOK = true; } else { exportOK = false; }