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

Commit f73cc8f

Browse files
author
Aleksi Salmela
committed
Add help message to admin command.
1 parent 6c758b7 commit f73cc8f

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

src/main/java/fi/helsinki/cs/tmc/cli/command/admin/AdminCommand.java

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,35 @@
4040
public class AdminCommand extends AbstractCommand {
4141

4242
private static final Logger logger = LoggerFactory.getLogger(AdminCommand.class);
43-
private Io io;
43+
private static final String HELP_TEXT =
44+
"Usage: tmc admin <COMMAND> [<command-arguments>] \n\n"
45+
+ "Commands:\n"
46+
+ "checkstyle --exercise=<PATH> --output=<PATH> --locale=<LOCALE>"
47+
+ " Run checkstyle or similar plugin to project if applicable.\n"
48+
+ "help"
49+
+ " Display help information.\n"
50+
+ "prepare-solutions --exercise=<PATH> --output=<PATH>"
51+
+ " Prepare a presentable solution from the original.\n"
52+
+ "prepare-stubs --exercise=<PATH> -- output=<PATH> --locale=<LOCALE>"
53+
+ " Prepare a stub exercise from the original.\n"
54+
+ "run-tests --exercise=<PATH> --output=<PATH>"
55+
+ " Run the tests for the exercise.\n"
56+
+ "scan-exercise --exercise=<PATH> --output=<PATH>"
57+
+ " Produce an exercise description of an exercise directory.\n"
58+
+ "find-exercises --exercise=<PATH> --output=<PATH>"
59+
+ " Produce list of found exercises.\n"
60+
+ "get-exercise-packaging-configuration --exercise=<PATH> --output=<PATH>"
61+
+ " Returns configuration of under which folders student and nonstudent"
62+
+ " files are located."
63+
+ "clean --exercise=<PATH>"
64+
+ " Produce list of found exercises.";
65+
// + "prepare-submission --clonePath --submissionPath --output=PATH"
66+
// + " Prepares from submission and solution project for which the tests"
67+
// + " can be run in sandbox";
4468

69+
private Io io;
4570
private TaskExecutor executor;
71+
4672
private Path exercisePath;
4773
private Path outputPath;
4874
private Locale locale;
@@ -86,7 +112,7 @@ public void run(CliContext context, CommandLine args) {
86112
private void runSubCommand(String subCommand) {
87113
switch (subCommand) {
88114
case "help":
89-
io.errorln("Not implemented!");
115+
printHelp();
90116
break;
91117
case "checkstyle":
92118
runCheckCodeStyle();
@@ -113,6 +139,7 @@ private void runSubCommand(String subCommand) {
113139
runClean();
114140
break;
115141
default:
142+
printHelp();
116143
break;
117144
}
118145
}
@@ -348,4 +375,8 @@ private static void writeObjectIntoJsonFormat(Object obj, Path outputFile) throw
348375
writer.write(new Gson().toJson(obj));
349376
}
350377
}
378+
379+
private void printHelp() {
380+
io.println(HELP_TEXT);
381+
}
351382
}

src/test/java/fi/helsinki/cs/tmc/cli/command/admin/AdminCommadTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929

3030
public class AdminCommadTest {
3131

32-
private static final String EXERCISE_PATH = "--exercise-path";
33-
private static final String OUTPUT_PATH = "--output-path";
34-
private static final String LOCALE = "--locale";
35-
3632
private Application app;
3733
private CliContext ctx;
3834
private TestIo io;

0 commit comments

Comments
 (0)