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
commit 84ea62ea0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)