Add commandLineParams to os.nim.
commandLineParams returns seq of arguments given to program on command line.
This commit is contained in:
parent
642a0d5563
commit
8dae664159
1 changed files with 6 additions and 0 deletions
|
|
@ -1481,6 +1481,12 @@ elif not defined(createNimRtl):
|
||||||
|
|
||||||
proc paramCount*(): int {.tags: [FReadIO].} = return cmdCount-1
|
proc paramCount*(): int {.tags: [FReadIO].} = return cmdCount-1
|
||||||
|
|
||||||
|
when defined(paramCount):
|
||||||
|
proc commandLineParams*(): seq[TaintedString] =
|
||||||
|
result = @[]
|
||||||
|
for i in 1..paramCount():
|
||||||
|
result.add(paramStr(i))
|
||||||
|
|
||||||
when defined(linux) or defined(solaris) or defined(bsd) or defined(aix):
|
when defined(linux) or defined(solaris) or defined(bsd) or defined(aix):
|
||||||
proc getApplAux(procPath: string): string =
|
proc getApplAux(procPath: string): string =
|
||||||
result = newString(256)
|
result = newString(256)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue