mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-18 10:37:12 +00:00
make system.task compatible with NimScript; refs #10254
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user