Rewrite some error messages for wrong argument amounts

This commit is contained in:
Jonas Tobias Hopusch 2022-03-12 03:23:28 +01:00
parent b53e7a617d
commit 1c48b1861f
Failed to generate hash of commit

View file

@ -67,16 +67,18 @@ public final class Main {
printVersionInformation(); printVersionInformation();
} else if (userData.length == 0) { } else if (userData.length == 0) {
switch (applicationOutputLanguage) { switch (applicationOutputLanguage) {
case GlobalConf.langGerman -> System.err.println("FATAL: Es wurde exact ein nicht-flag Argument erwartet. (" + userData.length + " erhalten)"); case GlobalConf.langGerman -> System.err.println("FATAL: " +
default -> System.err.println("FATAL: Expected one non-flag argument. (Got " + userData.length + ")"); "Es wurde keine Uhrzeit angegeben.");
default -> System.err.println("FATAL: No target time was " +
"provided.");
} }
System.exit(1); System.exit(1);
} else if (userData.length > 1) { } else if (userData.length > 1) {
switch (applicationOutputLanguage) { switch (applicationOutputLanguage) {
case GlobalConf.langGerman -> System.err.println("FATAL: " + case GlobalConf.langGerman -> System.err.println("FATAL: " +
"Es wurde exact ein nicht-flag Argument erwartet. (" + userData.length + " erhalten)"); "Zu viele Argumente wurden angegeben.");
default -> System.err.println("FATAL: Expected one " + default -> System.err.println("FATAL: Too many arguments " +
"non-flag argument. (Got " + userData.length + ")"); "provided.");
} }
System.exit(1); System.exit(1);
} else { } else {