@@ -5,7 +5,7 @@ import config.WurstProjectConfig
55import config.WurstProjectConfigData
66import global.InstallationManager
77import global.Log
8- import mu .KotlinLogging
8+ import logging .KotlinLogging
99import net.ConnectionManager
1010import net.NetStatus
1111import org.eclipse.jgit.api.Git
@@ -67,7 +67,16 @@ object SetupApp {
6767
6868 when {
6969 setup.command == CLICommand .HELP -> {
70- log.info(" Use one of the following commands: ${CLICommand .values().joinToString(" , " )} " )
70+ log.info("""
71+ |Available commands:
72+ | install [dep|wurstscript|grill] Install/update dependencies, WurstScript compiler, or grill itself
73+ | remove [dep|wurstscript] Remove a dependency or uninstall WurstScript
74+ | generate <name> Generate a new Wurst project in a subfolder
75+ | test [filter] Run unit tests, optionally filtered by package/function name
76+ | typecheck Typecheck the project without building a map
77+ | outdated Check whether project dependencies are up to date
78+ | build <mapfile> Build the project using the given input map
79+ """ .trimMargin())
7180 }
7281 setup.command == CLICommand .INSTALL -> {
7382 if (setup.commandArg.isBlank()) {
@@ -110,7 +119,7 @@ object SetupApp {
110119 }
111120 }
112121 setup.command == CLICommand .TYPECHECK -> {
113- log.info(" Typechecking project.." )
122+ log.info(" 🔍 Typechecking project.." )
114123 if (InstallationManager .status != InstallationManager .InstallationStatus .NOT_INSTALLED && configData != null ) {
115124 typecheckProject(configData)
116125 }
@@ -191,6 +200,10 @@ object SetupApp {
191200 val args = commonArgs(configData)
192201
193202 args.add(" -runtests" )
203+ if (setup.commandArg.isNotBlank()) {
204+ args.add(" -testFilter" )
205+ args.add(setup.commandArg.removeSuffix(" .wurst" ))
206+ }
194207
195208 val result = startWurstProcess(args)
196209 when (result) {
@@ -211,9 +224,9 @@ object SetupApp {
211224
212225 val result = startWurstProcess(args)
213226 when (result) {
214- 0 -> log.info(" Typecheck succeeded." )
227+ 0 -> log.info(" ✔ Typecheck succeeded." )
215228 else -> {
216- log.info(" Typecheck failed." )
229+ log.info(" ❌ Typecheck failed." )
217230 ExitHandler .exit(1 )
218231 }
219232 }
@@ -299,12 +312,12 @@ object SetupApp {
299312 WurstProjectConfig .handleUpdate(setup.projectRoot, null , configData)
300313 }
301314
302- val REPO_REGEX = Regex (" ((git@|http(s) ?://)([\\ w.@]+)([/:])) ([\\ w,\\ -, _]+)/([\\ w,\\ -, _]+)(.git)?((/)?)" )
315+ val REPO_REGEX = Regex (" (https ?://)([\\ w.@- ]+)(/) ([\\ w,- _]+)/([\\ w,- _]+)(.git)?((/)?)" )
303316
304317 private fun handleInstallDep (configData : WurstProjectConfigData ) {
305318 val resolvedName = DependencyManager .resolveName(setup.commandArg)
306319 if (! REPO_REGEX .matches(resolvedName.first)) {
307- log.info(" <${setup.commandArg} > does not appear to be a valid git repo link (e.g. https://github.com/user/repo)" )
320+ log.info(" <${setup.commandArg} > does not appear to be a supported git repo link (e.g. https://github.com/user/repo). SSH repo URLs are not bundled in the slim CLI. " )
308321 ExitHandler .exit(1 )
309322 }
310323 log.info(" 🔹 Installing ${resolvedName.second} " )
0 commit comments