Fix command line args setup (#120)
- commandLineParams is the correct way to access args
This commit is contained in:
parent
cf4a0a393e
commit
1088e43c2d
10
codex.nimble
10
codex.nimble
|
@ -37,8 +37,14 @@ proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
|
|||
mkDir "build"
|
||||
# allow something like "nim nimbus --verbosity:0 --hints:off nimbus.nims"
|
||||
var extra_params = params
|
||||
for i in 2..<paramCount():
|
||||
extra_params &= " " & paramStr(i)
|
||||
when compiles(commandLineParams):
|
||||
for param in commandLineParams:
|
||||
extra_params &= " " & param
|
||||
else:
|
||||
for i in 2..<paramCount():
|
||||
extra_params &= " " & paramStr(i)
|
||||
|
||||
|
||||
exec "nim " & lang & " --out:build/" & name & " " & extra_params & " " & srcDir & name & ".nim"
|
||||
|
||||
proc test(name: string, srcDir = "tests/", lang = "c") =
|
||||
|
|
Loading…
Reference in New Issue