Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 8d19ec9

Browse files
author
Aleksi Salmela
committed
Fix unnamed option at submit.
1 parent a1a2972 commit 8d19ec9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/fi/helsinki/cs/tmc/cli/command/SubmitCommand.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class SubmitCommand extends AbstractCommand {
3838
private Io io;
3939
private boolean showAll;
4040
private boolean showDetails;
41+
private boolean filterUncompleted;
4142

4243
@Override
4344
public void getOptions(Options options) {
@@ -70,15 +71,15 @@ public void run(CliContext context, CommandLine args) {
7071
}
7172

7273
List<String> exerciseNames;
73-
if (args.hasOption("c")) {
74+
if (filterUncompleted) {
7475
workDir.addPath(workDir.getCourseDirectory());
7576
exerciseNames = workDir.getExerciseNames(true, true);
7677
} else {
7778
exerciseNames = workDir.getExerciseNames();
7879
}
7980

8081
if (exerciseNames.isEmpty()) {
81-
if (args.hasOption("c") && workDir.getCourseDirectory() != null) {
82+
if (filterUncompleted && workDir.getCourseDirectory() != null) {
8283
io.println("No locally tested exercises.");
8384
return;
8485
}
@@ -209,6 +210,7 @@ private void checkForExerciseUpdates(Course course) {
209210
private String[] parseArgs(CommandLine args) {
210211
this.showAll = args.hasOption("a");
211212
this.showDetails = args.hasOption("d");
213+
this.filterUncompleted = args.hasOption("c");
212214
return args.getArgs();
213215
}
214216
}

0 commit comments

Comments
 (0)