From 3e2f0a6bcf54ae59f4902f8a380891154204e57f Mon Sep 17 00:00:00 2001 From: zaaarf Date: Fri, 1 Sep 2023 12:17:37 +0200 Subject: feat: updated to new mapper library version --- src/main/java/ftbsc/lll/mapper/writer/MappingWriter.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 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 a884b3a..188532b 100644 --- a/src/main/java/ftbsc/lll/mapper/writer/MappingWriter.java +++ b/src/main/java/ftbsc/lll/mapper/writer/MappingWriter.java @@ -1,7 +1,7 @@ package ftbsc.lll.mapper.writer; -import ftbsc.lll.mapper.IMapper; import ftbsc.lll.mapper.MapperProvider; +import ftbsc.lll.mapper.tools.Mapper; import org.apache.commons.cli.*; import java.io.File; @@ -16,7 +16,7 @@ import java.util.*; public class MappingWriter { /** - * The main function, must be passed exactly two arguments + * The main function. * @param args the command line arguments * @throws IOException if something goes wrong while writing the file * @throws ParseException if something goes wrong while parsin arguments @@ -43,7 +43,7 @@ public class MappingWriter { args = newArgs; } else customArgs = new String[0]; - if(args.length < 4) { + if(args.length < 3) { System.err.println("Bad argument count!"); System.err.println("java -jar mapping-writer.jar [-r] [-a lines = MapperProvider.fetchFromLocalOrRemote(args[0]); - IMapper mapper = MapperProvider.getMapper(lines); - mapper.populate(lines, false); - if(cmdLine.hasOption("reverse")) - mapper = mapper.getInverted(); + Mapper mapper = !cmdLine.hasOption("reverse") + ? MapperProvider.getMapper(lines).getMapper(lines, false) + : MapperProvider.getMapper(lines).getInvertedMapper(lines, false); //load the writers Map writerMap = new HashMap<>(); -- cgit v1.2.3-56-ga3b1