4040public 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}
0 commit comments