Expand globs for templates + files & Add default prompt value
This commit is contained in:
@@ -4,5 +4,15 @@ import com.github.ajalt.clikt.core.CliktCommand
|
||||
import scaffold.Generators
|
||||
|
||||
class ListCommand(private val generators: Generators) : CliktCommand("list") {
|
||||
override fun run() = echo(generators.findAll().joinToString(" ") { it.last().toString() })
|
||||
override fun run() {
|
||||
val generators = generators.findAll()
|
||||
|
||||
if (generators.isEmpty()) {
|
||||
echo("No generators yet, you can create one with `scaffold new`")
|
||||
} else {
|
||||
generators.forEach {
|
||||
echo(it.last())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user