From c220472d5acc34c806f4b7464c6c268136bfe7dc Mon Sep 17 00:00:00 2001 From: zaaarf Date: Fri, 31 May 2024 19:41:42 +0200 Subject: fix: assorted bugfixes --- .../java/ftbsc/lll/mapper/writer/MappingWriter.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/main/java/ftbsc/lll/mapper/writer/MappingWriter.java') 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] [-a ]"); + System.err.println("java -jar mapping-writer.jar [-r] [-o] [[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(); } } -- cgit v1.2.3-56-ga3b1