make system.task compatible with NimScript; refs #10254

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

View file

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