summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
author zaaarf <me@zaaarf.foo>2024-05-31 19:41:42 +0200
committer zaaarf <me@zaaarf.foo>2024-05-31 19:41:42 +0200
commitc220472d5acc34c806f4b7464c6c268136bfe7dc (patch)
tree5d1f0fd751d568f04167dac777a1111f1a1fa10a /src/main
parent81ec0e4140a4016f5b9c88d3400c5c181b6d1493 (diff)
fix: assorted bugfixesHEAD0.1.1dev
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/ftbsc/lll/mapper/writer/MappingWriter.java18
-rw-r--r--src/main/java/ftbsc/lll/mapper/writer/impl/TinyV2Writer.java4
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) ->