make system.task compatible with NimScript; refs #10254

This commit is contained in:
Araq
2019-01-13 09:04:13 +01:00
parent 2823da5e52
commit 5cd18b0f24

View File

@@ -341,14 +341,15 @@ when not defined(nimble):
## .. code-block:: nim
## task build, "default build is via the C backend":
## setCommand "c"
proc `name Task`*() = body
proc `name Task`*() =
setCommand "nop"
body
let cmd = getCommand()
if cmd.len == 0 or cmd ==? "help":
setCommand "help"
writeTask(astToStr(name), description)
elif cmd ==? astToStr(name):
setCommand "nop"
`name Task`()
# nimble has its own implementation for these things.