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

Commit 7e8e8c4

Browse files
author
Aleksi Salmela
committed
Merge branch 'redo-multi-login-support-aleksi' of https://github.com/tmc-cli/tmc-cli into redo-multi-login-support-aleksi
2 parents 12067eb + f67351a commit 7e8e8c4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,24 @@ private void printStatistics(Course course, int requestCount, int downloadCount)
151151
if (course.getExercises().isEmpty()) {
152152
io.println("The '" + courseName + "' course doesn't have any exercises.");
153153
} else {
154+
int totalCount = course.getExercises().size();
154155
io.println("The '" + courseName + "' course has "
155-
+ course.getExercises().size() + " exercises");
156+
+ totalCount + " exercises available");
156157

157158
int failedCount = (requestCount - downloadCount);
158159
if (failedCount > 0) {
159-
io.println(" from which " + (requestCount - failedCount)
160+
io.println(" of which " + (requestCount - failedCount)
160161
+ " exercises were succesfully downloaded");
161162
io.println(Color.colorString(" and of which " + failedCount + " failed.",
162163
Color.AnsiColor.ANSI_RED));
163164
//TODO we could print the names of the not downloaded exercises here
164165
} else {
165-
io.println(" from which "
166+
io.println(" of which "
166167
+ downloadCount + " exercises were downloaded.");
167168
}
168-
io.println("Use -a/--all to download completed exercises as well.");
169+
if (!showAll && totalCount != downloadCount) {
170+
io.println("Use -a/--all to download completed exercises as well.");
171+
}
169172
}
170173
}
171174

src/test/java/fi/helsinki/cs/tmc/cli/command/DownloadExercisesCommandTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public void failsToLoadExercises() throws ParseException {
204204
app.run(args);
205205

206206
io.assertContains("The 'course1' course has 3 exercises");
207-
io.assertContains("from which 2 exercises were succesfully downloaded");
207+
io.assertContains("of which 2 exercises were succesfully downloaded");
208208
io.assertContains("and of which 1 failed.");
209209
}
210210

0 commit comments

Comments
 (0)