diff options
Diffstat (limited to 'src/main/java/ftbsc/lll/mapper/writer')
-rw-r--r-- | src/main/java/ftbsc/lll/mapper/writer/MappingWriter.java | 18 | ||||
-rw-r--r-- | src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java | 4 |
2 files changed, 4 insertions, 18 deletions
diff --git a/src/main/java/ftbsc/lll/mapper/writer/MappingWriter.java b/src/main/java/ftbsc/lll/mapper/writer/MappingWriter.java index 36b117f..eb073b5 100644 --- a/src/main/java/ftbsc/lll/mapper/writer/MappingWriter.java +++ b/src/main/java/ftbsc/lll/mapper/writer/MappingWriter.java @@ -30,23 +30,9 @@ public class MappingWriter { args = cmdLine.getArgs(); //separate normal args from custom args - int cursor; - for(cursor = 0; cursor < args.length; cursor++) - if(args[cursor].equals("-a")) - break; - String[] customArgs; - if(cursor != args.length) { - int len = args.length - cursor - 1; - customArgs = new String[len]; - System.arraycopy(args, cursor + 1, customArgs, 0, len); - String[] newArgs = new String[cursor]; - System.arraycopy(args, 0, newArgs, 0, cursor); - args = newArgs; - } else customArgs = new String[0]; - if(args.length < 3) { System.err.println("Bad argument count!"); - System.err.println("java -jar mapping-writer.jar [-r] [-o] <location> <format> <output> [-a <custom args>]"); + System.err.println("java -jar mapping-writer.jar [-r] [-o] <location> <format> <output> [[custom args]]"); return; } @@ -85,7 +71,7 @@ public class MappingWriter { //call the writer PrintWriter printWriter = new PrintWriter(new FileWriter(targetFile)); - writer.write(mapper, printWriter, customArgs); + writer.write(mapper, printWriter, Arrays.copyOfRange(args, 3, args.length)); printWriter.close(); } } diff --git a/src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java b/src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java index 68d769a..d63db24 100644 --- a/src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java +++ b/src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java @@ -20,8 +20,8 @@ public class TinyV2Writer implements IWriter { @Override public void write(Mapper mapper, PrintWriter writer, String... args) { if(args.length < 2) - throw new RuntimeException("Please provide the namespaces for the tiny format after the -a flag!"); - writer.printf("tiny\t2\t0\t%s\t%s", args[0], args[1]); + throw new RuntimeException("Please provide the namespaces for the tiny format as additional arguments!"); + writer.printf("tiny\t2\t0\t%s\t%s\n", args[0], args[1]); mapper.getRawMappings().forEach((name, data) -> { writer.printf("c\t%s\t%s\n", name, data.nameMapped); data.getFields().forEach((fieldName, fieldData) -> |