Move command line parameter code (#20946)

Command line paramater code moved from os.nim to cmdparam.nim

Co-authored-by: IgorDeepakM <IgorDeepak@noreply.com>
This commit is contained in:
IgorDeepakM
2022-11-30 11:00:26 +01:00
committed by GitHub
parent 8f728ace35
commit 84ea62ea0d
3 changed files with 318 additions and 272 deletions

View File

@@ -54,14 +54,12 @@ when defined(windows) and not weirdTarget:
proc findFirstFile*(a: string, b: var WIN32_FIND_DATA): Handle =
result = findFirstFileW(newWideCString(a), b)
template findNextFile*(a, b: untyped): untyped = findNextFileW(a, b)
template getCommandLine*(): untyped = getCommandLineW()
template getFilename*(f: untyped): untyped =
$cast[WideCString](addr(f.cFileName[0]))
else:
template findFirstFile*(a, b: untyped): untyped = findFirstFileA(a, b)
template findNextFile*(a, b: untyped): untyped = findNextFileA(a, b)
template getCommandLine*(): untyped = getCommandLineA()
template getFilename*(f: untyped): untyped = $cast[cstring](addr f.cFileName)