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

Commit dae2f06

Browse files
author
jclc
committed
Added option for submitting completed exercises
1 parent 03304dc commit dae2f06

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
@Command(name = "submit", desc = "Submit exercises")
2929
public class SubmitCommand extends AbstractCommand {
3030

31-
private static final Logger logger = LoggerFactory.getLogger(RunTestsCommand.class);
31+
private static final Logger logger = LoggerFactory.getLogger(SubmitCommand.class);
3232

3333
private Io io;
3434
private boolean showAll;
@@ -38,6 +38,7 @@ public class SubmitCommand extends AbstractCommand {
3838
public void getOptions(Options options) {
3939
options.addOption("a", "all", false, "Show all test results");
4040
options.addOption("d", "details", false, "Show detailed error message");
41+
options.addOption("c", "completed", false, "Only exercises that have passed all tests");
4142
}
4243

4344
@Override
@@ -63,7 +64,13 @@ public void run(CommandLine args, Io io) {
6364
}
6465
}
6566

66-
List<String> exerciseNames = workDir.getExerciseNames();
67+
List<String> exerciseNames;
68+
if (args.hasOption("c")) {
69+
exerciseNames = workDir.getExerciseNames(true, true, false);
70+
} else {
71+
exerciseNames = workDir.getExerciseNames();
72+
}
73+
6774
if (exerciseNames.isEmpty()) {
6875
io.println("You have to be in a course directory to submit");
6976
return;

0 commit comments

Comments
 (0)