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

Commit e022120

Browse files
authored
Merge pull request #369 from tmc-cli/download-msg-fix-juha
Do not print -a switch msg if -a switch was used
2 parents 6bdba86 + 154e784 commit e022120

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ private void printStatistics(Course course, int requestCount, int downloadCount)
137137
if (course.getExercises().isEmpty()) {
138138
io.println("The '" + courseName + "' course doesn't have any exercises.");
139139
} else {
140+
int totalCount = course.getExercises().size();
140141
io.println("The '" + courseName + "' course has "
141-
+ course.getExercises().size() + " exercises");
142+
+ totalCount + " exercises available");
142143

143144
int failedCount = (requestCount - downloadCount);
144145
if (failedCount > 0) {
@@ -151,7 +152,9 @@ private void printStatistics(Course course, int requestCount, int downloadCount)
151152
io.println(" of which "
152153
+ downloadCount + " exercises were downloaded.");
153154
}
154-
io.println("Use -a/--all to download completed exercises as well.");
155+
if (!showAll && totalCount != downloadCount) {
156+
io.println("Use -a/--all to download completed exercises as well.");
157+
}
155158
}
156159
}
157160

0 commit comments

Comments
 (0)