diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 35f1753..cf9d6a1 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -9,7 +9,7 @@
-
+
@@ -99,7 +99,15 @@
1723514215355
-
+
+
+ 1723520355301
+
+
+
+ 1723520355301
+
+
@@ -108,6 +116,7 @@
-
+
+
\ No newline at end of file
diff --git a/net/screwgravity/vitality4j/standalone.java b/net/screwgravity/vitality4j/standalone.java
index e7ea901..47fe0dd 100644
--- a/net/screwgravity/vitality4j/standalone.java
+++ b/net/screwgravity/vitality4j/standalone.java
@@ -13,6 +13,7 @@ public class standalone {
static String operation = "";
static String targetPath; // psarc file
static String sourcePath; // folder contents to import when using -c, list of files to export when using -x
+ static boolean overwrite = false;
static Scotty.CompressionFormats targetFormat = Scotty.CompressionFormats.ZLIB;
static byte targetStrength = 9;
static long targetBlockSize = 65536; // in bytes
@@ -45,34 +46,40 @@ public class standalone {
} else if (args.length > 0) {
if (args[0].equals("-h")) {
printHelpScreen();
- if (args.length > 1 && args[1].equals("-j")) {
- printAboutScreen();
- }
System.exit(0);
}
for (String s : args) {
- if (!argIsTakingParam) {
+ if (!argIsTakingParam) { // The options
switch (s) {
case "-j":
argIsTakingParam = false;
printAboutScreen();
+ if (args.length == 1) {System.exit(0);}
+ else if (args.length == 2 && args[1].equals("-h")) {
+ printHelpScreen();
+ System.exit(0);
+ }
break;
case "-h":
- if (argWhichIsTakingParam == null) {
- printHelpScreen();
- } else {
- System.out.println("WARNING: Argument \"-h\" provided but other commands were already given first, ignoring.");
- }
+ System.out.println("WARNING: Argument \"-h\" provided but other commands were already given first, ignoring.");
break;
case "-q":
argIsTakingParam = false;
argWhichIsTakingParam = s;
verbosity = Verbosities.QUIET;
+ System.out.println("INFO: Set output to quiet mode.");
break;
case "-v":
argIsTakingParam = false;
argWhichIsTakingParam = s;
verbosity = Verbosities.VERBOSE;
+ System.out.println("INFO: Set output to verbose mode.");
+ break;
+ case "-y":
+ argIsTakingParam = false;
+ argWhichIsTakingParam = s;
+ overwrite = true;
+ System.out.println("INFO: Automatic overwrite enabled.");
break;
case "-i", "-t", "-e":
argIsTakingParam = false;
@@ -80,23 +87,72 @@ public class standalone {
setOperation(s);
break;
case "-I", "-c", "-E", "-x":
+ if (s.equals("-c")) {throwUnimplementedAndThenCrash(s);} // todo
argIsTakingParam = true;
argWhichIsTakingParam = s;
setOperation(s);
break;
+ case "-b", "-g", "-s":
+ throwUnimplementedAndThenCrash(s); // todo
+ argIsTakingParam = true;
+ argWhichIsTakingParam = s;
+ break;
+ case "-u":
+ argIsTakingParam = false;
+ argWhichIsTakingParam = s;
+ targetFormat = Scotty.CompressionFormats.NONE;
+ break;
+ case "-z":
+ argIsTakingParam = false;
+ argWhichIsTakingParam = s;
+ targetFormat = Scotty.CompressionFormats.ZLIB;
+ break;
+ case "-l":
+ argIsTakingParam = false;
+ argWhichIsTakingParam = s;
+ targetFormat = Scotty.CompressionFormats.LZMA;
+ break;
+ case "-r":
+ argIsTakingParam = false;
+ argWhichIsTakingParam = s;
+ makeAbsolute = false;
+ break;
+ case "-a":
+ argIsTakingParam = false;
+ argWhichIsTakingParam = s;
+ makeAbsolute = true;
+ break;
+ case "-n":
+ argIsTakingParam = false;
+ argWhichIsTakingParam = s;
+ makeCaseInsensitive = true;
+ break;
default:
System.out.println("invalid option: " + s);
+ System.exit(1);
break;
}
- } else {
-
+ } else { // And then the options for those options
+ switch (argWhichIsTakingParam) {
+ case "":
+ }
}
}
+
+ if (verbosity != Verbosities.QUIET) {
+ System.out.println("INFO: absolute mode is " + makeAbsolute);
+ System.out.println("INFO: case insensitive mode is " + makeCaseInsensitive);
+ }
}
}
+ private static void throwUnimplementedAndThenCrash(String str) {
+ System.out.println("Feature " + str + " is unimplemented. Closing.");
+ System.exit(0);
+ }
+
private static void setOperation(String str) {
- if (!operation.isEmpty()) {System.out.println("WARNING: duplicate operation " + str + " replaces previous argument.");}
+ if (!operation.isEmpty()) {System.out.println("WARNING: duplicate operation " + str + " replaces previous argument \"" + operation + "\".");}
operation = str;
}