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

Commit dacfc50

Browse files
author
jclc
committed
Merge branch 'update-man-jclc' of github.com:tmc-cli/tmc-cli into update-man-jclc
2 parents 6561864 + 48e7928 commit dacfc50

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ public void run(CommandLine args, Io io) {
6363
}
6464

6565
if (!ctx.hasLogin()) {
66-
io.println("Loading course from internet requires login.");
66+
io.println("Loading a course from a server requires login.");
6767
return;
6868
}
6969

7070
course = TmcUtil.findCourse(ctx, stringArgs[0]);
7171
if (course == null) {
72-
io.println("The course " + stringArgs[0] + " doesn't exist on this server.");
72+
io.println("The course " + stringArgs[0] + " doesn't exist on the server.");
7373
return;
7474
}
7575
printCourse(args.hasOption("a"));

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void getOptions(Options options) {
4141
public void run(CommandLine args, Io io) {
4242
String[] stringArgs = args.getArgs();
4343
if (stringArgs.length == 0 || stringArgs.length > 1) {
44-
io.println("You must give course name as an argument.");
44+
io.println("You must give a course name as an argument.");
4545
io.println("Usage: tmc download COURSE");
4646
return;
4747
}
@@ -137,21 +137,24 @@ 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) {
145-
io.println(" from which " + (requestCount - failedCount)
146+
io.println(" of which " + (requestCount - failedCount)
146147
+ " exercises were succesfully downloaded");
147148
io.println(Color.colorString(" and of which " + failedCount + " failed.",
148149
Color.AnsiColor.ANSI_RED));
149150
//TODO we could print the names of the not downloaded exercises here
150151
} else {
151-
io.println(" from which "
152+
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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public void printsErrorIfInCourseDirectoryAndGivenCourseNameThatDoesntExistOnThe
188188

189189
String[] args = {"info", "notacourse", "-i"};
190190
app.run(args);
191-
io.assertContains("doesn't exist on this server.");
191+
io.assertContains("doesn't exist on the server.");
192192
}
193193

194194
@Test

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
@@ -201,7 +201,7 @@ public void failsToLoadExercises() throws ParseException {
201201
app.run(args);
202202

203203
io.assertContains("The 'course1' course has 3 exercises");
204-
io.assertContains("from which 2 exercises were succesfully downloaded");
204+
io.assertContains("of which 2 exercises were succesfully downloaded");
205205
io.assertContains("and of which 1 failed.");
206206
}
207207

0 commit comments

Comments
 (0)