From bf32ff1ae5edc4e73b057a314fe5252624d43646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 22 Jan 2024 00:16:35 +0100 Subject: [PATCH] Cli help - add minus for commands --- build.xml | 1 - resources/ffdec | 14 +- resources/ffdec-cli | 17 --- resources/ffdec-cli.bat | 21 --- resources/ffdec.bat | 2 +- resources/ffdec.sh | 125 ++++++++++++++++- resources/run-java.sh | 132 ------------------ resources/translator.sh | 106 +------------- .../console/CommandLineArgumentParser.java | 117 ++++++++-------- 9 files changed, 189 insertions(+), 346 deletions(-) delete mode 100644 resources/ffdec-cli delete mode 100644 resources/ffdec-cli.bat delete mode 100644 resources/run-java.sh diff --git a/build.xml b/build.xml index 60ec8b22f..89bcfb390 100644 --- a/build.xml +++ b/build.xml @@ -559,7 +559,6 @@ - diff --git a/resources/ffdec b/resources/ffdec index 412385cb6..9d469dca4 100644 --- a/resources/ffdec +++ b/resources/ffdec @@ -1,17 +1,5 @@ #!/usr/bin/env bash -# This is a comment, it starts with "#". - -# Uncomment following and set it to higher value if you want more memory -# You need 64 bit OS and 64 bit java to set it to higher values -# FFDEC_MEMORY=1024m - -# Uncomment following when you encounter StackOverFlowErrors. -# If the app then terminates with OutOfMemory you can experiment with lower value. -# FFDEC_STACK_SIZE=32m - -# Hide VLC error output -export VLC_VERBOSE=-1 export FFDEC_JARFILENAME=ffdec.jar SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -exec $SCRIPT_DIR/run-java.sh "$@" +exec $SCRIPT_DIR/ffdec.sh "$@" diff --git a/resources/ffdec-cli b/resources/ffdec-cli deleted file mode 100644 index 34fdbadda..000000000 --- a/resources/ffdec-cli +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# This is a comment, it starts with "#". - -# Uncomment following and set it to higher value if you want more memory -# You need 64 bit OS and 64 bit java to set it to higher values -# FFDEC_MEMORY=1024m - -# Uncomment following when you encounter StackOverFlowErrors. -# If the app then terminates with OutOfMemory you can experiment with lower value. -# FFDEC_STACK_SIZE=32m - -# Hide VLC error output -export VLC_VERBOSE=-1 -export FFDEC_JARFILENAME=ffdec-cli.jar -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -exec $SCRIPT_DIR/run-java.sh "$@" diff --git a/resources/ffdec-cli.bat b/resources/ffdec-cli.bat deleted file mode 100644 index 324592e90..000000000 --- a/resources/ffdec-cli.bat +++ /dev/null @@ -1,21 +0,0 @@ -@echo off -rem This is a comment, it starts with "rem". - -rem Uncomment following and set it to higher value if you want more memory: -rem You need 64 bit OS and 64 bit java to set it to higher values -rem set FFDEC_MEMORY=1024m - -rem Uncomment following when you encounter StackOverFlowErrors. -rem If the app then terminates with OutOfMemory you can experiment with lower value. -rem set FFDEC_STACK_SIZE=32m - -rem Hide VLC error output -set VLC_VERBOSE=-1 - -if "%FFDEC_MEMORY%"=="" set FFDEC_MEMORY=1024m -set STACK_SIZE_PARAM= -set MEMORY_PARAM= -if not "%FFDEC_STACK_SiZE%"=="" set STACK_SIZE_PARAM= -Xss%FFDEC_STACK_SiZE% -if not "%FFDEC_MEMORY%"=="" set MEMORY_PARAM=-Xmx%FFDEC_MEMORY% - -java %MEMORY_PARAM%%STACK_SIZE_PARAM%-Djna.nosys=true -jar "%~dp0\ffdec-cli.jar" %* diff --git a/resources/ffdec.bat b/resources/ffdec.bat index 49202d76a..4f5956d49 100644 --- a/resources/ffdec.bat +++ b/resources/ffdec.bat @@ -19,4 +19,4 @@ set MEMORY_PARAM= if not "%FFDEC_STACK_SiZE%"=="" set STACK_SIZE_PARAM= -Xss%FFDEC_STACK_SiZE% if not "%FFDEC_MEMORY%"=="" set MEMORY_PARAM=-Xmx%FFDEC_MEMORY% -java %MEMORY_PARAM%%STACK_SIZE_PARAM%-Djna.nosys=true -jar "%~dp0\ffdec.jar" %* \ No newline at end of file +java %MEMORY_PARAM%%STACK_SIZE_PARAM%-Djna.nosys=true -jar "%~dp0\ffdec.jar" %* diff --git a/resources/ffdec.sh b/resources/ffdec.sh index 412385cb6..f2406c8a2 100644 --- a/resources/ffdec.sh +++ b/resources/ffdec.sh @@ -10,8 +10,127 @@ # If the app then terminates with OutOfMemory you can experiment with lower value. # FFDEC_STACK_SIZE=32m + # Hide VLC error output export VLC_VERBOSE=-1 -export FFDEC_JARFILENAME=ffdec.jar -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -exec $SCRIPT_DIR/run-java.sh "$@" + +# FFDec requires Oracle Java 8 +# Look for java in these directories +LOOKUP_JRE_DIRS="/usr/lib/jvm/* /opt/java* /opt/jre*" +# Required version +REQ_JVER1=1 +REQ_JVER2=8 +REQ_JVER3=0 +REQ_JVER4=0 + + +if [ -z ${FFDEC_JARFILENAME+x} ]; then + FFDEC_JARFILENAME=ffdec.jar +fi + +search_jar_file() { + JAR_FILE_CANDIDATES="./${FFDEC_JARFILENAME} ../dist/${FFDEC_JARFILENAME} /usr/share/java/${FFDEC_JARFILENAME} /usr/share/java/ffdec/${FFDEC_JARFILENAME} /usr/share/java/jpexs-decompiler/${FFDEC_JARFILENAME}" + for f in $JAR_FILE_CANDIDATES ; do + [ -r "$f" ] && JAR_FILE="$f" && return 0 + done + echo Unable to find ${FFDEC_JARFILE} in the following locations: + echo "${JAR_FILE_CANDIDATES// /$'\n'}" + return 1 +} + +check_java_version () { + JVER1=$(echo $JAVA_VERSION_OUTPUT | sed 's/java version "\([0-9]*\)\.[0-9]*\.[0-9]*\(_[0-9]*\)\?".*/\1/') + JVER2=$(echo $JAVA_VERSION_OUTPUT | sed 's/java version "[0-9]*\.\([0-9]*\)\.[0-9]*\(_[0-9]*\)\?".*/\1/') + JVER3=$(echo $JAVA_VERSION_OUTPUT | sed 's/java version "[0-9]*\.[0-9]*\.\([0-9]*\)\(_[0-9]*\)\?".*/\1/') + JVER4=$(echo $JAVA_VERSION_OUTPUT | sed 's/java version "[0-9]*\.[0-9]*\.[0-9]*\(_\([0-9]*\)\)\?".*/\2/' | sed 's/^$/0/') + + if [ "$JVER1" -gt $REQ_JVER1 ]; then + return 0 + elif [ "$JVER1" -lt $REQ_JVER1 ]; then + return 1 + fi + + if [ "$JVER2" -gt $REQ_JVER2 ]; then + return 0 + elif [ "$JVER2" -lt $REQ_JVER2 ]; then + return 1 + fi + + if [ "$JVER3" -gt $REQ_JVER3 ]; then + return 0 + elif [ "$JVER3" -lt $REQ_JVER3 ]; then + return 1 + fi + + if [ "$JVER4" -lt $REQ_JVER4 ]; then + return 1 + fi + + return 0 +} + +# Handle symlinks +PROGRAM="$0" +while [ -L "$PROGRAM" ]; do + PROGRAM=$(readlink -f "$PROGRAM") +done +pushd "$(dirname "$PROGRAM")" > /dev/null + +search_jar_file || exit 1 + +if [ "${JAR_FILE:0:1}" != '/' ] ; then + JAR_FILE=$(pwd)/$JAR_FILE +fi + +popd > /dev/null + +if [ -z ${FFDEC_MEMORY+x} ]; then + FFDEC_MEMORY=1024m +fi + +STACK_SIZE_PARAM="" +MEMORY_PARAM="" +if [ -n "$FFDEC_STACK_SIZE" ]; then + STACK_SIZE_PARAM=" -Xss$FFDEC_STACK_SIZE" +fi +if [ -n "$FFDEC_MEMORY" ]; then + MEMORY_PARAM=" -Xmx$FFDEC_MEMORY" +fi + +args=(-Djava.net.preferIPv4Stack=true${MEMORY_PARAM}${STACK_SIZE_PARAM} -jar $JAR_FILE "$@") + +if [ "$(uname)" = "Darwin" ]; then + args=(-Xdock:name=FFDec -Xdock:icon=icon.png "${args[@]}") +fi + +# Check default java +if [ -x "$(which java)" ]; then + JAVA_VERSION_OUTPUT=$(java -version 2>&1) + JAVA_VERSION_OUTPUT=$(echo $JAVA_VERSION_OUTPUT | sed 's/openjdk version/java version/') + check_java_version && exec java "${args[@]}" +fi + +# Test other possible Java locations +for JRE_PATH in $LOOKUP_JRE_DIRS; do + if [ -x "$JRE_PATH/bin/java" ]; then + JAVA_VERSION_OUTPUT=$("$JRE_PATH/bin/java" -version 2>&1) + JAVA_VERSION_OUTPUT=`echo $JAVA_VERSION_OUTPUT | sed 's/openjdk version/java version/'` + check_java_version && { + export JRE_PATH + exec "$JRE_PATH/bin/java" "${args[@]}" + } + fi +done + +# Failed +if [ -x "$(which xmessage)" ]; then + xmessage -nearmouse -file - < /dev/null - -search_jar_file || exit 1 - -if [ "${JAR_FILE:0:1}" != '/' ] ; then - JAR_FILE=$(pwd)/$JAR_FILE -fi - -popd > /dev/null - -if [ -z ${FFDEC_MEMORY+x} ]; then - FFDEC_MEMORY=1024m -fi - -STACK_SIZE_PARAM="" -MEMORY_PARAM="" -if [ -n "$FFDEC_STACK_SIZE" ]; then - STACK_SIZE_PARAM=" -Xss$FFDEC_STACK_SIZE" -fi -if [ -n "$FFDEC_MEMORY" ]; then - MEMORY_PARAM=" -Xmx$FFDEC_MEMORY" -fi - -args=(-Djava.net.preferIPv4Stack=true${MEMORY_PARAM}${STACK_SIZE_PARAM} -jar $JAR_FILE "$@") - -if [ "$(uname)" = "Darwin" ]; then - args=(-Xdock:name=FFDec -Xdock:icon=icon.png "${args[@]}") -fi - -# Check default java -if [ -x "$(which java)" ]; then - JAVA_VERSION_OUTPUT=$(java -version 2>&1) - JAVA_VERSION_OUTPUT=$(echo $JAVA_VERSION_OUTPUT | sed 's/openjdk version/java version/') - check_java_version && exec java "${args[@]}" -fi - -# Test other possible Java locations -for JRE_PATH in $LOOKUP_JRE_DIRS; do - if [ -x "$JRE_PATH/bin/java" ]; then - JAVA_VERSION_OUTPUT=$("$JRE_PATH/bin/java" -version 2>&1) - JAVA_VERSION_OUTPUT=`echo $JAVA_VERSION_OUTPUT | sed 's/openjdk version/java version/'` - check_java_version && { - export JRE_PATH - exec "$JRE_PATH/bin/java" "${args[@]}" - } - fi -done - -# Failed -if [ -x "$(which xmessage)" ]; then - xmessage -nearmouse -file - < /dev/null - -search_jar_file || exit 1 - -if [ ${JAR_FILE:0:1} != '/' ] ; then - JAR_FILE=`pwd`/$JAR_FILE -fi - -popd > /dev/null - -args=(-jar $JAR_FILE -translator) - -if [ "`uname`" = "Darwin" ]; then - args=(-Xdock:name=FFDec -Xdock:icon=icon.png "${args[@]}") -fi - -# Check default java -if [ -x "`which java`" ]; then - JAVA_VERSION_OUTPUT=`java -version 2>&1` - JAVA_VERSION_OUTPUT=`echo $JAVA_VERSION_OUTPUT | sed 's/openjdk version/java version/'` - check_java_version && exec java "${args[@]}" -fi - -# Test other possible Java locations -for JRE_PATH in $LOOKUP_JRE_DIRS; do - if [ -x "$JRE_PATH/bin/java" ]; then - JAVA_VERSION_OUTPUT=`"$JRE_PATH/bin/java" -version 2>&1` - JAVA_VERSION_OUTPUT=`echo $JAVA_VERSION_OUTPUT | sed 's/openjdk version/java version/'` - check_java_version && { - export JRE_PATH - exec $JRE_PATH/bin/java "${args[@]}" - } - fi -done - -# Failed -if [ -x "`which xmessage`" ]; then - xmessage -nearmouse -file - < /dev/null && pwd ) +exec $SCRIPT_DIR/ffdec.sh translator diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 3d4fce0f0..18740bed1 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -335,7 +335,14 @@ public class CommandLineArgumentParser { public static void printCmdLineUsage(PrintStream out, boolean webHelp, String filter) { int cnt = 1; - out.println("@|underline,bold Usage|@: @|bold ffdec-cli|@ [PRE-OPTIONS] [COMMAND]"); + out.println("@|underline,bold Usage|@: @|bold |@ [PRE-OPTIONS] [COMMAND]"); + out.println(); + out.println("@|underline,bold Executable|@:"); + out.println(" Linux: ffdec or ffdec.sh"); + out.println(" Mac OS: ffdec.sh"); + out.println(" Windows: ffdec-cli.exe or ffdec.bat"); + out.println(" Java: java -jar ffdec.jar"); + out.println(); out.println("@|underline,bold Commands|@:"); if (filter == null) { out.println("@|bold -help|@ | @|bold --help|@ | @|bold /?|@"); @@ -347,13 +354,13 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("proxy")) { - out.println("@|bold proxy|@ [-P]"); + out.println("@|bold -proxy|@ [-P]"); out.println(" auto start proxy in the tray. Optional parameter -P specifies port for proxy. Defaults to 55555. "); out.println(); } if (filter == null || filter.equals("export")) { - out.println("@|bold export|@ "); + out.println("@|bold -export|@ "); out.println(" export sources to ."); out.println(" Exports all files from when it is a folder."); out.println(" Values for parameter:"); @@ -380,61 +387,61 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("dumpswf")) { - out.println("@|bold dumpSWF|@ "); + out.println("@|bold -dumpSWF|@ "); out.println(" dumps list of SWF tags to console"); out.println(); } if (filter == null || filter.equals("dumpas2")) { - out.println("@|bold dumpAS2|@ "); + out.println("@|bold -dumpAS2|@ "); out.println(" dumps list of AS1/2 scripts to console"); out.println(); } if (filter == null || filter.equals("dumpas3")) { - out.println("@|bold dumpAS3|@ "); + out.println("@|bold -dumpAS3|@ "); out.println(" dumps list of AS3 scripts to console"); out.println(); } if (filter == null || filter.equals("compress")) { - out.println("@|bold compress|@ [(zlib|lzma)]"); + out.println("@|bold -compress|@ [(zlib|lzma)]"); out.println(" Compress SWF and save it to . If is already compressed, it will be re-compressed. Default compression method is ZLIB"); out.println(); } if (filter == null || filter.equals("decompress")) { - out.println("@|bold decompress|@ "); + out.println("@|bold -decompress|@ "); out.println(" Decompress and save it to "); out.println(); } if (filter == null || filter.equals("encrypt")) { - out.println("@|bold encrypt|@ "); + out.println("@|bold -encrypt|@ "); out.println(" Encrypts file with HARMAN Air encryption and saves it to "); out.println(); } if (filter == null || filter.equals("decrypt")) { - out.println("@|bold decrypt|@ "); + out.println("@|bold -decrypt|@ "); out.println(" Decrypts HARMAN Air encrypted file and saves it to "); out.println(); } if (filter == null || filter.equals("swf2xml")) { - out.println("@|bold swf2xml|@ "); + out.println("@|bold -swf2xml|@ "); out.println(" Converts the SWF to XML file"); out.println(); } if (filter == null || filter.equals("xml2swf")) { - out.println("@|bold xml2swf|@ "); + out.println("@|bold -xml2swf|@ "); out.println(" Converts the XML to SWF file"); out.println(); } if (filter == null || filter.equals("extract")) { - out.println("@|bold extract|@ [-o |] [nocheck] [(all|biggest|smallest|first|last)]"); + out.println("@|bold -extract|@ [-o |] [nocheck] [(all|biggest|smallest|first|last)]"); out.println(" Extracts SWF files from ZIP or other binary files"); out.println(" -o parameter should contain a file path when \"biggest\" or \"first\" parameter is specified"); out.println(" -o parameter should contain a folder path when no extaction mode or \"all\" parameter is specified"); @@ -442,25 +449,25 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("memorysearch")) { - out.println("@|bold memorySearch|@ (|) (|)..."); + out.println("@|bold -memorySearch|@ (|) (|)..."); out.println(" Search SWF files in the memory"); out.println(); } if (filter == null || filter.equals("renameinvalididentifiers")) { - out.println("@|bold renameInvalidIdentifiers|@ (typeNumber|randomWord) "); + out.println("@|bold -renameInvalidIdentifiers|@ (typeNumber|randomWord) "); out.println(" Renames the invalid identifiers in and save it to "); out.println(); } if (filter == null || filter.equals("flashpaper2pdf")) { - out.println("@|bold flashpaper2pdf|@ "); + out.println("@|bold -flashpaper2pdf|@ "); out.println(" converts FlashPaper SWF file to PDF . Use -zoom parameter to specify image quality."); out.println(); } if (filter == null || filter.equals("replace")) { - out.println("@|bold replace|@ (|) [nofill] ([][]) [(|) [nofill] ([][])]..."); + out.println("@|bold -replace|@ (|) [nofill] ([][]) [(|) [nofill] ([][])]..."); out.println(" replaces the data of the specified BinaryData, Image, Shape, Text, Sound tag or Script"); out.println(" nofill parameter can be specified only for shape replace"); out.println(" parameter can be specified for Image and Shape tags"); @@ -468,26 +475,26 @@ public class CommandLineArgumentParser { out.println(" parameter should be specified if and only if the imported entity is an AS3 P-Code"); out.println(" use -1 as characterId to replace main timeline SoundStreamHead"); - out.println("@|bold replace|@ "); + out.println("@|bold -replace|@ "); out.println(" same as -replace command, but the rest of arguments is read as lines from a text file "); out.println(); } if (filter == null || filter.equals("replacealpha")) { - out.println("@|bold replaceAlpha|@ [ ]..."); + out.println("@|bold -replaceAlpha|@ [ ]..."); out.println(" replaces the alpha channel of the specified JPEG3 or JPEG4 tag"); out.println(); } if (filter == null || filter.equals("replacecharacter")) { - out.println("@|bold replaceCharacter|@ [ ]..."); + out.println("@|bold -replaceCharacter|@ [ ]..."); out.println(" replaces a character tag with another character tag from the same SWF"); out.println(); } if (filter == null || filter.equals("replacecharacterid")) { - out.println("@|bold replaceCharacterId|@ ,,,... or"); - out.println("@|bold replaceCharacterId|@ (pack|sort)"); + out.println("@|bold -replaceCharacterId|@ ,,,... or"); + out.println("@|bold -replaceCharacterId|@ (pack|sort)"); out.println(" replaces the character id with "); out.println(" pack: removes the spaces between the character ids (1,4,3 => 1,3,2)"); out.println(" sort: assigns increasing IDs to the character tags + pack (1,4,3 => 1,2,3)"); @@ -496,74 +503,74 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("remove")) { - out.println("@|bold remove|@ []..."); + out.println("@|bold -remove|@ []..."); out.println(" removes a tag from the SWF"); out.println(); } if (filter == null || filter.equals("removecharacter")) { - out.println("@|bold removeCharacter[WithDependencies]|@ []..."); + out.println("@|bold -removeCharacter[WithDependencies]|@ []..."); out.println(" removes a character tag from the SWF"); out.println(); } if (filter == null || filter.equals("importsymbolclass")) { - out.println("@|bold importSymbolClass|@ "); + out.println("@|bold -importSymbolClass|@ "); out.println(" imports Symbol-Class mapping to and saves the result to "); out.println(); } if (filter == null || filter.equals("importmovies")) { - out.println("@|bold importMovies|@ "); + out.println("@|bold -importMovies|@ "); out.println(" imports movies to and saves the result to "); out.println(); } if (filter == null || filter.equals("importsounds")) { - out.println("@|bold importSounds|@ "); + out.println("@|bold -importSounds|@ "); out.println(" imports sounds to and saves the result to "); out.println(); } if (filter == null || filter.equals("importshapes")) { - out.println("@|bold importShapes|@ [nofill] "); + out.println("@|bold -importShapes|@ [nofill] "); out.println(" imports shapes to and saves the result to "); out.println(); } if (filter == null || filter.equals("importimages")) { - out.println("@|bold importImages|@ "); + out.println("@|bold -importImages|@ "); out.println(" imports images to and saves the result to "); out.println(); } if (filter == null || filter.equals("importsprites")) { - out.println("@|bold importSprites|@ "); + out.println("@|bold -importSprites|@ "); out.println(" imports sprites to and saves the result to "); out.println(); } if (filter == null || filter.equals("importtext")) { - out.println("@|bold importText|@ "); + out.println("@|bold -importText|@ "); out.println(" imports texts to and saves the result to "); out.println(); } if (filter == null || filter.equals("importscript")) { - out.println("@|bold importScript|@ "); + out.println("@|bold -importScript|@ "); out.println(" imports scripts to and saves the result to "); out.println(); } if (filter == null || filter.equals("deobfuscate")) { - out.println("@|bold deobfuscate|@ "); + out.println("@|bold -deobfuscate|@ "); out.println(" Deobfuscates AS3 P-code in and saves result to "); out.println(" can be one of: traps/2/max, deadcode/1"); out.println(); } if (filter == null || filter.equals("enabledebugging")) { - out.println("@|bold enabledebugging|@ [-injectas3|-generateswd] [-pcode] "); + out.println("@|bold -enabledebugging|@ [-injectas3|-generateswd] [-pcode] "); out.println(" Enables debugging for and saves result to "); out.println(" -injectas3 (optional) causes debugfile and debugline instructions to be injected into the code to match decompiled/pcode source."); out.println(" -generateswd (optional) parameter creates SWD file needed for AS1/2 debugging. for , is generated"); @@ -573,7 +580,7 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("doc")) { - out.println("@|bold doc|@ -type [-out ] [-format ] [-locale ]"); + out.println("@|bold -doc|@ -type [-out ] [-format ] [-locale ]"); out.println(" Generate documentation"); out.println(" -type Selects documentation type"); out.println(" can be currently only: as3.pcode.instructions for list of ActionScript3 AVM2 instructions"); @@ -587,7 +594,7 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("getinstancemetadata")) { - out.println("@|bold getInstanceMetadata|@ -instance [-outputFormat ] [-key ] [-datafile ] "); + out.println("@|bold -getInstanceMetadata|@ -instance [-outputFormat ] [-key ] [-datafile ] "); out.println(" reads instance metadata"); out.println(" -instance : name of instance to fetch metadata from"); out.println(" -outputFormat (optional): format of output - one of: jslike|raw. Default is jslike."); @@ -598,7 +605,7 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("setinstancemetadata")) { - out.println("@|bold setInstanceMetadata|@ -instance [-inputFormat ] [-key ] [-value | -datafile ] [-outfile ] "); + out.println("@|bold -setInstanceMetadata|@ -instance [-inputFormat ] [-key ] [-value | -datafile ] [-outfile ] "); out.println(" adds metadata to instance"); out.println(" -instance : name of instance to replace data in"); out.println(" -inputFormat : format of input data - one of: jslike|raw. Default is jslike."); @@ -613,7 +620,7 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("removeinstancemetadata")) { - out.println("@|bold removeInstanceMetadata|@ -instance [-key ] [-outfile ] "); + out.println("@|bold -removeInstanceMetadata|@ -instance [-key ] [-outfile ] "); out.println(" removes metadata from instance"); out.println(" -instance : name of instance to remove data from"); out.println(" - key (optional): name of subkey to remove. When present, only the value from subkey of the AMF object is removed."); @@ -624,7 +631,7 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("linkreport")) { - out.println("@|bold linkReport|@ [-outfile ] "); + out.println("@|bold -linkReport|@ [-outfile ] "); out.println(" generates linker report for the swffile"); out.println(" -outfile (optional): Saves XML report to . When ommited, the report is printed to stdout."); out.println(" : SWF file to search instance in"); @@ -632,7 +639,7 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("swf2swc")) { - out.println("@|bold swf2swc|@ "); + out.println("@|bold -swf2swc|@ "); out.println(" generates SWC file from SWF"); out.println(" : Where to save SWC file"); out.println(" : Input SWF file"); @@ -640,7 +647,7 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("abcmerge")) { - out.println("@|bold abcmerge|@ "); + out.println("@|bold -abcmerge|@ "); out.println(" merge all ABC tags in SWF file to one"); out.println(" : Where to save merged file"); out.println(" : Input SWF file"); @@ -648,14 +655,14 @@ public class CommandLineArgumentParser { } if (filter == null || filter.equals("swf2exe")) { - out.println("@|bold swf2exe|@ "); + out.println("@|bold -swf2exe|@ "); out.println(" export SWF to executable file"); out.println(" : wrapper|projector_win||projector_mac|projector_linux"); out.println(); } if (filter == null || filter.equals("header")) { - out.println("@|bold header|@ -set [-set ...] []"); + out.println("@|bold -header|@ -set [-set ...] []"); out.println(" prints header or sets SWF header values (with -set arguments) in and saves it to "); out.println(" Available keys: version"); out.println(" gfx (true/false)"); @@ -672,7 +679,7 @@ public class CommandLineArgumentParser { out.println("@|underline,bold Pre-options|@:"); if (filter == null || filter.equals("format")) { out.println("@|yellow -format|@ "); - out.println(" Applies to: export COMMAND"); + out.println(" Applies to: -export COMMAND"); out.println(" sets output formats for export"); out.println(" Values for parameter:"); out.println(" script:as - ActionScript source"); @@ -734,7 +741,7 @@ public class CommandLineArgumentParser { if (filter == null || filter.equals("select")) { out.println("@|yellow -select|@ "); - out.println(" Applies to: export COMMAND"); + out.println(" Applies to: -export COMMAND"); out.println(" selects frames/pages for export"); out.println(" Example formats:"); out.println(" 1-5"); @@ -751,7 +758,7 @@ public class CommandLineArgumentParser { if (filter == null || filter.equals("selectclass")) { out.println("@|yellow -selectclass|@ "); - out.println(" Applies to: export COMMAND"); + out.println(" Applies to: -export COMMAND"); out.println(" selects scripts to export by class name (ActionScript 3 ONLY)"); out.println(" format:"); out.println(" com.example.MyClass"); @@ -763,7 +770,7 @@ public class CommandLineArgumentParser { if (filter == null || filter.equals("exportembed")) { out.println("@|yellow -exportembed|@"); - out.println(" Applies to: export COMMAND"); + out.println(" Applies to: -export COMMAND"); out.println(" Allows exporting embedded assets via [Embed tag]"); out.println(); } @@ -781,7 +788,7 @@ public class CommandLineArgumentParser { if (filter == null || filter.equals("onerror")) { out.println("@|yellow -onerror|@ (abort|retry |ignore)"); - out.println(" Applies to: export, import COMMANDs"); + out.println(" Applies to: -export, -import COMMANDs"); out.println(" error handling mode: "); out.println(" \"abort\" stops the exporting"); out.println(" \"retry\" tries the exporting N times"); @@ -791,35 +798,35 @@ public class CommandLineArgumentParser { if (filter == null || filter.equals("timeout")) { out.println("@|yellow -timeout|@ "); - out.println(" Applies to: export COMMAND"); + out.println(" Applies to: -export COMMAND"); out.println(" decompilation timeout for a single method in AS3 or single action in AS1/2 in seconds"); out.println(); } if (filter == null || filter.equals("exporttimeout")) { out.println("@|yellow -exportTimeout|@ "); - out.println(" Applies to: export COMMAND"); + out.println(" Applies to: -export COMMAND"); out.println(" total export timeout in seconds"); out.println(); } if (filter == null || filter.equals("exportfiletimeout")) { out.println("@|yellow -exportFileTimeout|@ "); - out.println(" Applies to: export COMMAND"); + out.println(" Applies to: -export COMMAND"); out.println(" export timeout for a single AS3 class in seconds"); out.println(); } if (filter == null || filter.equals("stat")) { out.println("@|yellow -stat|@"); - out.println(" Applies to: export COMMAND"); + out.println(" Applies to: -export COMMAND"); out.println(" show export performance statistics"); out.println(); } if (filter == null || filter.equals("zoom")) { out.println("@|yellow -zoom|@ "); - out.println(" Applies to: export, flashpaper2pdf COMMANDs"); + out.println(" Applies to: -export, -flashpaper2pdf COMMANDs"); out.println(" apply zoom during export"); out.println(); } @@ -840,7 +847,7 @@ public class CommandLineArgumentParser { if (filter == null || filter.equals("air")) { out.println("@|yellow -air|@"); - out.println(" Applies to: replace, import COMMANDs"); + out.println(" Applies to: -replace, -import COMMANDs"); out.println(" use AIR (airglobal.swc) for AS3 compilation instead of playerglobal.swc"); out.println(); } @@ -854,7 +861,7 @@ public class CommandLineArgumentParser { out.println(); out.println("@|underline,bold Examples|@:"); - final String PREFIX = "ffdec-cli "; + final String PREFIX = "ffdec "; boolean exampleFound = false; if (filter == null) {