feat: better cli input

This commit is contained in:
Timo Ley 2023-05-21 09:49:28 +02:00
parent 702200b220
commit cf21f34a1a
2 changed files with 11 additions and 1 deletions

View File

@ -14,3 +14,10 @@ application {
mainClass = 'ma2tetr.App'
}
jar {
manifest {
attributes(
"Main-Class": "ma2tetr.App"
)
}
}

View File

@ -10,7 +10,10 @@ public class App {
public static void main(String[] args) {
double radius;
if (args.length != 2) {
throw new RuntimeException("Needs 2 arguments");
System.out.println("Required arguments: <calculator> <radius>");
System.out.println(" - calculator: either 'scaling' or 'moving'");
System.out.println(" - radius: the sphere radius as a number");
return;
}
try {
radius = Double.parseDouble(args[1]);