diff options
| author | 2015-01-13 23:40:23 -0500 | |
|---|---|---|
| committer | 2015-01-13 23:40:23 -0500 | |
| commit | 56c036d7d18e2e18682bf14d71e8dbecf266072a (patch) | |
| tree | bae04751e6504b52d3ce5e8d521f24e94a7bd8c7 | |
| parent | source format change (diff) | |
| download | enigma-56c036d7d18e2e18682bf14d71e8dbecf266072a.tar.gz enigma-56c036d7d18e2e18682bf14d71e8dbecf266072a.tar.xz enigma-56c036d7d18e2e18682bf14d71e8dbecf266072a.zip | |
started on command line interface for build system
| -rw-r--r-- | src/cuchaz/enigma/CommandMain.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/cuchaz/enigma/CommandMain.java b/src/cuchaz/enigma/CommandMain.java index 7f881749..6a01661b 100644 --- a/src/cuchaz/enigma/CommandMain.java +++ b/src/cuchaz/enigma/CommandMain.java | |||
| @@ -3,5 +3,41 @@ package cuchaz.enigma; | |||
| 3 | public class CommandMain { | 3 | public class CommandMain { |
| 4 | 4 | ||
| 5 | public static void main(String[] args) { | 5 | public static void main(String[] args) { |
| 6 | |||
| 7 | // parse the args | ||
| 8 | if (args.length < 1) { | ||
| 9 | printHelp(); | ||
| 10 | return; | ||
| 11 | } | ||
| 12 | |||
| 13 | // process the command | ||
| 14 | String command = args[0]; | ||
| 15 | if (command.equalsIgnoreCase("deobfuscate")) { | ||
| 16 | deobfuscate(args); | ||
| 17 | } else if(command.equalsIgnoreCase("decompile")) { | ||
| 18 | decompile(args); | ||
| 19 | } else { | ||
| 20 | System.out.println("Command not recognized: " + args[0]); | ||
| 21 | printHelp(); | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | private static void printHelp() { | ||
| 26 | System.out.println(String.format("%s - %s", Constants.Name, Constants.Version)); | ||
| 27 | System.out.println("Usage:"); | ||
| 28 | System.out.println("\tjava -jar enigma.jar cuchaz.enigma.CommandMain <command>"); | ||
| 29 | System.out.println("\twhere <command> is one of:"); | ||
| 30 | System.out.println("\t\tdeobfuscate <mappings file> <in jar> <out jar>"); | ||
| 31 | System.out.println("\t\tdecompile <mappings file> <in jar> <out jar>"); | ||
| 32 | } | ||
| 33 | |||
| 34 | private static void decompile(String[] args) { | ||
| 35 | // TODO | ||
| 36 | throw new Error("Not implemented yet"); | ||
| 37 | } | ||
| 38 | |||
| 39 | private static void deobfuscate(String[] args) { | ||
| 40 | // TODO | ||
| 41 | throw new Error("Not implemented yet"); | ||
| 6 | } | 42 | } |
| 7 | } | 43 | } |