Skip to content

Commit f502c9b

Browse files
Error out when a required commandline argument is left out
1 parent 0a3b82a commit f502c9b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/processing/app/Base.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,18 +344,24 @@ public Base(String[] args) throws Exception {
344344
i++;
345345
if (i < args.length)
346346
selectBoard = args[i];
347+
else
348+
showError(null, "Argument required for --board", null);
347349
continue;
348350
}
349351
if (args[i].equals("--port")) {
350352
i++;
351353
if (i < args.length)
352354
selectPort = args[i];
355+
else
356+
showError(null, "Argument required for --port", null);
353357
continue;
354358
}
355359
if (args[i].equals("--curdir")) {
356360
i++;
357361
if (i < args.length)
358362
currentDirectory = args[i];
363+
else
364+
showError(null, "Argument required for --curdir", null);
359365
continue;
360366
}
361367
if (args[i].startsWith("--"))

0 commit comments

Comments
 (0)