summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/impure/re.nim2
-rw-r--r--lib/pure/asyncnet.nim16
-rw-r--r--lib/pure/base64.nim2
-rw-r--r--lib/pure/httpclient.nim6
-rw-r--r--lib/pure/net.nim110
-rw-r--r--testament/backend.nim4
-rw-r--r--testament/categories.nim6
-rw-r--r--testament/htmlgen.nim2
-rw-r--r--testament/testament.nim14
-rw-r--r--tools/nimfind.nim8
10 files changed, 85 insertions, 85 deletions
diff --git a/lib/impure/re.nim b/lib/impure/re.nim
index fe3ea96ff..24841b40e 100644
--- a/lib/impure/re.nim
+++ b/lib/impure/re.nim
@@ -122,7 +122,7 @@ proc bufSubstr(b: cstring, sPos, ePos: int): string {.inline.} =
   ## Don't assume cstring is '\0' terminated
   let sz = ePos - sPos
   result = newString(sz+1)
-  copyMem(addr(result[0]), unsafeAddr(b[sPos]), sz)
+  copyMem(addr(result[0]), unsafeaddr(b[sPos]), sz)
   result.setLen(sz)
 
 proc matchOrFind(buf: cstring, pattern: Regex, matches: var openArray[string],
diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim
index 410310e29..0bdbeb29b 100644
--- a/lib/pure/asyncnet.nim
+++ b/lib/pure/asyncnet.nim
@@ -202,7 +202,7 @@ proc newAsyncSocket*(domain, sockType, protocol: cint,
 when defineSsl:
   proc getSslError(handle: SslPtr, err: cint): cint =
     assert err < 0
-    var ret = SSL_get_error(handle, err.cint)
+    var ret = SSLGetError(handle, err.cint)
     case ret
     of SSL_ERROR_ZERO_RETURN:
       raiseSSLError("TLS/SSL connection failed to initiate, socket closed prematurely.")
@@ -224,9 +224,9 @@ when defineSsl:
       let read = bioRead(socket.bioOut, addr data[0], len)
       assert read != 0
       if read < 0:
-        raiseSSLError()
+        raiseSslError()
       data.setLen(read)
-      await socket.fd.AsyncFD.send(data, flags)
+      await socket.fd.AsyncFd.send(data, flags)
 
   proc appeaseSsl(socket: AsyncSocket, flags: set[SocketFlag],
                   sslError: cint): owned(Future[bool]) {.async.} =
@@ -727,7 +727,7 @@ proc close*(socket: AsyncSocket) =
       if res == 0:
         discard
       elif res != 1:
-        raiseSSLError()
+        raiseSslError()
   socket.closed = true # TODO: Add extra debugging checks for this.
 
 when defineSsl:
@@ -739,12 +739,12 @@ when defineSsl:
     ## prone to security vulnerabilities.
     socket.isSsl = true
     socket.sslContext = ctx
-    socket.sslHandle = SSL_new(socket.sslContext.context)
+    socket.sslHandle = SSLNew(socket.sslContext.context)
     if socket.sslHandle == nil:
-      raiseSSLError()
+      raiseSslError()
 
-    socket.bioIn = bioNew(bioSMem())
-    socket.bioOut = bioNew(bioSMem())
+    socket.bioIn = bioNew(bio_s_mem())
+    socket.bioOut = bioNew(bio_s_mem())
     sslSetBio(socket.sslHandle, socket.bioIn, socket.bioOut)
 
   proc wrapConnectedSocket*(ctx: SslContext, socket: AsyncSocket,
diff --git a/lib/pure/base64.nim b/lib/pure/base64.nim
index 9495c4d56..c140b9714 100644
--- a/lib/pure/base64.nim
+++ b/lib/pure/base64.nim
@@ -229,7 +229,7 @@ proc decode*(s: string): string =
     return (size * 3 div 4) + 6
 
   template inputChar(x: untyped) =
-    let x = int decodeTable[ord(s[inputIndex])]
+    let x = int decode_table[ord(s[inputIndex])]
     inc inputIndex
     if x == invalidChar:
       raise newException(ValueError,
diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim
index 92e4cd2d6..e8936f87b 100644
--- a/lib/pure/httpclient.nim
+++ b/lib/pure/httpclient.nim
@@ -313,10 +313,10 @@ proc fileError(msg: string) =
   raise e
 
 when not defined(ssl):
-  type SslContext = ref object
-var defaultSslContext {.threadvar.}: SslContext
+  type SSLContext = ref object
+var defaultSslContext {.threadvar.}: SSLContext
 
-proc getDefaultSSL(): SslContext =
+proc getDefaultSSL(): SSLContext =
   result = defaultSslContext
   when defined(ssl):
     if result == nil:
diff --git a/lib/pure/net.nim b/lib/pure/net.nim
index 7aeffbc35..d18f18c92 100644
--- a/lib/pure/net.nim
+++ b/lib/pure/net.nim
@@ -128,8 +128,8 @@ type
     bufLen: int            # current length of buffer
     when defineSsl:
       isSsl: bool
-      sslHandle: SslPtr
-      sslContext: SslContext
+      sslHandle: SSLPtr
+      sslContext: SSLContext
       sslNoHandshake: bool # True if needs handshake.
       sslHasPeekChar: bool
       sslPeekChar: char
@@ -469,15 +469,15 @@ proc fromSockAddr*(sa: Sockaddr_storage | SockAddr | Sockaddr_in | Sockaddr_in6,
 when defineSsl:
   CRYPTO_malloc_init()
   doAssert SslLibraryInit() == 1
-  SSL_load_error_strings()
-  ERR_load_BIO_strings()
+  SslLoadErrorStrings()
+  ErrLoadBioStrings()
   OpenSSL_add_all_algorithms()
 
   proc raiseSSLError*(s = "") =
     ## Raises a new SSL error.
     if s != "":
-      raise newException(SslError, s)
-    let err = ERR_peek_last_error()
+      raise newException(SSLError, s)
+    let err = ErrPeekLastError()
     if err == 0:
       raise newException(SslError, "No error reported.")
     var errStr = $ERR_error_string(err, nil)
@@ -487,10 +487,10 @@ when defineSsl:
                "necessary protocols. OpenSSL error is: " & errStr
     else:
       discard
-    raise newException(SslError, errStr)
+    raise newException(SSLError, errStr)
 
-  proc getExtraData*(ctx: SslContext, index: int): RootRef =
-    ## Retrieves arbitrary data stored inside SslContext.
+  proc getExtraData*(ctx: SSLContext, index: int): RootRef =
+    ## Retrieves arbitrary data stored inside SSLContext.
     if index notin ctx.referencedData:
       raise newException(IndexDefect, "No data with that index.")
     let res = ctx.context.SSL_CTX_get_ex_data(index.cint)
@@ -498,8 +498,8 @@ when defineSsl:
       raiseSSLError()
     return cast[RootRef](res)
 
-  proc setExtraData*(ctx: SslContext, index: int, data: RootRef) =
-    ## Stores arbitrary data inside SslContext. The unique `index`
+  proc setExtraData*(ctx: SSLContext, index: int, data: RootRef) =
+    ## Stores arbitrary data inside SSLContext. The unique `index`
     ## should be retrieved using getSslContextExtraDataIndex.
     if index in ctx.referencedData:
       GC_unref(getExtraData(ctx, index))
@@ -520,7 +520,7 @@ when defineSsl:
       raise newException(system.IOError, "Key file could not be found: " & keyFile)
 
     if certFile != "":
-      var ret = SSL_CTX_use_certificate_chain_file(ctx, certFile)
+      var ret = SSLCTXUseCertificateChainFile(ctx, certFile)
       if ret != 1:
         raiseSSLError()
 
@@ -567,18 +567,18 @@ when defineSsl:
     ## or using ECDSA:
     ## - ``openssl ecparam -out mykey.pem -name secp256k1 -genkey``
     ## - ``openssl req -new -key mykey.pem -x509 -nodes -days 365 -out mycert.pem``
-    var newCTX: SslCtx
+    var newCTX: SSL_CTX
     case protVersion
     of protSSLv23:
       newCTX = SSL_CTX_new(SSLv23_method()) # SSlv2,3 and TLS1 support.
     of protSSLv2:
-      raiseSSLError("SSLv2 is no longer secure and has been deprecated, use protSSLv23")
+      raiseSslError("SSLv2 is no longer secure and has been deprecated, use protSSLv23")
     of protSSLv3:
-      raiseSSLError("SSLv3 is no longer secure and has been deprecated, use protSSLv23")
+      raiseSslError("SSLv3 is no longer secure and has been deprecated, use protSSLv23")
     of protTLSv1:
       newCTX = SSL_CTX_new(TLSv1_method())
 
-    if newCTX.SSL_CTX_set_cipher_list(cipherList) != 1:
+    if newCTX.SSLCTXSetCipherList(cipherList) != 1:
       raiseSSLError()
     when not defined(openssl10) and not defined(libressl):
       let sslVersion = getOpenSSLVersion()
@@ -631,11 +631,11 @@ when defineSsl:
     result = SSLContext(context: newCTX, referencedData: initHashSet[int](),
       extraInternal: new(SslContextExtraInternal))
 
-  proc getExtraInternal(ctx: SslContext): SslContextExtraInternal =
+  proc getExtraInternal(ctx: SSLContext): SslContextExtraInternal =
     return ctx.extraInternal
 
-  proc destroyContext*(ctx: SslContext) =
-    ## Free memory referenced by SslContext.
+  proc destroyContext*(ctx: SSLContext) =
+    ## Free memory referenced by SSLContext.
 
     # We assume here that OpenSSL's internal indexes increase by 1 each time.
     # That means we can assume that the next internal index is the length of
@@ -644,20 +644,20 @@ when defineSsl:
       GC_unref(getExtraData(ctx, i).RootRef)
     ctx.context.SSL_CTX_free()
 
-  proc `pskIdentityHint=`*(ctx: SslContext, hint: string) =
+  proc `pskIdentityHint=`*(ctx: SSLContext, hint: string) =
     ## Sets the identity hint passed to server.
     ##
     ## Only used in PSK ciphersuites.
     if ctx.context.SSL_CTX_use_psk_identity_hint(hint) <= 0:
       raiseSSLError()
 
-  proc clientGetPskFunc*(ctx: SslContext): SslClientGetPskFunc =
+  proc clientGetPskFunc*(ctx: SSLContext): SslClientGetPskFunc =
     return ctx.getExtraInternal().clientGetPskFunc
 
   proc pskClientCallback(ssl: SslPtr; hint: cstring; identity: cstring;
       max_identity_len: cuint; psk: ptr cuchar;
       max_psk_len: cuint): cuint {.cdecl.} =
-    let ctx = SslContext(context: ssl.SSL_get_SSL_CTX)
+    let ctx = SSLContext(context: ssl.SSL_get_SSL_CTX)
     let hintString = if hint == nil: "" else: $hint
     let (identityString, pskString) = (ctx.clientGetPskFunc)(hintString)
     if psk.len.cuint > max_psk_len:
@@ -670,7 +670,7 @@ when defineSsl:
 
     return pskString.len.cuint
 
-  proc `clientGetPskFunc=`*(ctx: SslContext, fun: SslClientGetPskFunc) =
+  proc `clientGetPskFunc=`*(ctx: SSLContext, fun: SslClientGetPskFunc) =
     ## Sets function that returns the client identity and the PSK based on identity
     ## hint from the server.
     ##
@@ -679,12 +679,12 @@ when defineSsl:
     ctx.context.SSL_CTX_set_psk_client_callback(
         if fun == nil: nil else: pskClientCallback)
 
-  proc serverGetPskFunc*(ctx: SslContext): SslServerGetPskFunc =
+  proc serverGetPskFunc*(ctx: SSLContext): SslServerGetPskFunc =
     return ctx.getExtraInternal().serverGetPskFunc
 
   proc pskServerCallback(ssl: SslCtx; identity: cstring; psk: ptr cuchar;
       max_psk_len: cint): cuint {.cdecl.} =
-    let ctx = SslContext(context: ssl.SSL_get_SSL_CTX)
+    let ctx = SSLContext(context: ssl.SSL_get_SSL_CTX)
     let pskString = (ctx.serverGetPskFunc)($identity)
     if psk.len.cint > max_psk_len:
       return 0
@@ -692,7 +692,7 @@ when defineSsl:
 
     return pskString.len.cuint
 
-  proc `serverGetPskFunc=`*(ctx: SslContext, fun: SslServerGetPskFunc) =
+  proc `serverGetPskFunc=`*(ctx: SSLContext, fun: SslServerGetPskFunc) =
     ## Sets function that returns PSK based on the client identity.
     ##
     ## Only used in PSK ciphersuites.
@@ -702,10 +702,10 @@ when defineSsl:
 
   proc getPskIdentity*(socket: Socket): string =
     ## Gets the PSK identity provided by the client.
-    assert socket.isSsl
+    assert socket.isSSL
     return $(socket.sslHandle.SSL_get_psk_identity)
 
-  proc wrapSocket*(ctx: SslContext, socket: Socket) =
+  proc wrapSocket*(ctx: SSLContext, socket: Socket) =
     ## Wraps a socket in an SSL context. This function effectively turns
     ## ``socket`` into an SSL socket.
     ##
@@ -716,16 +716,16 @@ when defineSsl:
     ## **Disclaimer**: This code is not well tested, may be very unsafe and
     ## prone to security vulnerabilities.
 
-    assert(not socket.isSsl)
-    socket.isSsl = true
+    assert(not socket.isSSL)
+    socket.isSSL = true
     socket.sslContext = ctx
-    socket.sslHandle = SSL_new(socket.sslContext.context)
+    socket.sslHandle = SSLNew(socket.sslContext.context)
     socket.sslNoHandshake = false
     socket.sslHasPeekChar = false
     if socket.sslHandle == nil:
       raiseSSLError()
 
-    if SSL_set_fd(socket.sslHandle, socket.fd) != 1:
+    if SSLSetFd(socket.sslHandle, socket.fd) != 1:
       raiseSSLError()
 
   proc checkCertName(socket: Socket, hostname: string) =
@@ -819,7 +819,7 @@ proc getSocketError*(socket: Socket): OSErrorCode =
 
 proc socketError*(socket: Socket, err: int = -1, async = false,
                   lastError = (-1).OSErrorCode) =
-  ## Raises an OSError based on the error code returned by ``SSL_get_error``
+  ## Raises an OSError based on the error code returned by ``SSLGetError``
   ## (for SSL sockets) and ``osLastError`` otherwise.
   ##
   ## If ``async`` is ``true`` no error will be thrown in the case when the
@@ -827,9 +827,9 @@ proc socketError*(socket: Socket, err: int = -1, async = false,
   ##
   ## If ``err`` is not lower than 0 no exception will be raised.
   when defineSsl:
-    if socket.isSsl:
+    if socket.isSSL:
       if err <= 0:
-        var ret = SSL_get_error(socket.sslHandle, err.cint)
+        var ret = SSLGetError(socket.sslHandle, err.cint)
         case ret
         of SSL_ERROR_ZERO_RETURN:
           raiseSSLError("TLS/SSL connection failed to initiate, socket closed prematurely.")
@@ -845,13 +845,13 @@ proc socketError*(socket: Socket, err: int = -1, async = false,
           raiseSSLError("Function for x509 lookup has been called.")
         of SSL_ERROR_SYSCALL:
           var errStr = "IO error has occurred "
-          let sslErr = ERR_peek_last_error()
+          let sslErr = ErrPeekLastError()
           if sslErr == 0 and err == 0:
             errStr.add "because an EOF was observed that violates the protocol"
           elif sslErr == 0 and err == -1:
             errStr.add "in the BIO layer"
           else:
-            let errStr = $ERR_error_string(sslErr, nil)
+            let errStr = $ErrErrorString(sslErr, nil)
             raiseSSLError(errStr & ": " & errStr)
           let osErr = osLastError()
           raiseOSError(osErr, errStr)
@@ -859,7 +859,7 @@ proc socketError*(socket: Socket, err: int = -1, async = false,
           raiseSSLError()
         else: raiseSSLError("Unknown Error")
 
-  if err == -1 and not (when defineSsl: socket.isSsl else: false):
+  if err == -1 and not (when defineSsl: socket.isSSL else: false):
     var lastE = if lastError.int == -1: getSocketError(socket) else: lastError
     if async:
       when useWinVersion:
@@ -939,7 +939,7 @@ proc acceptAddr*(server: Socket, client: var owned(Socket), address: var string,
 
     # Handle SSL.
     when defineSsl:
-      if server.isSsl:
+      if server.isSSL:
         # We must wrap the client sock in a ssl context.
 
         server.sslContext.wrapSocket(client)
@@ -949,7 +949,7 @@ proc acceptAddr*(server: Socket, client: var owned(Socket), address: var string,
 
 when false: #defineSsl:
   proc acceptAddrSSL*(server: Socket, client: var Socket,
-                      address: var string): SSL_acceptResult {.
+                      address: var string): SSLAcceptResult {.
                       tags: [ReadIOEffect].} =
     ## This procedure should only be used for non-blocking **SSL** sockets.
     ## It will immediately return with one of the following values:
@@ -967,16 +967,16 @@ when false: #defineSsl:
     ## to connect.
     template doHandshake(): untyped =
       when defineSsl:
-        if server.isSsl:
+        if server.isSSL:
           client.setBlocking(false)
           # We must wrap the client sock in a ssl context.
 
-          if not client.isSsl or client.sslHandle == nil:
+          if not client.isSSL or client.sslHandle == nil:
             server.sslContext.wrapSocket(client)
           ErrClearError()
           let ret = SSL_accept(client.sslHandle)
           while ret <= 0:
-            let err = SSL_get_error(client.sslHandle, ret)
+            let err = SSLGetError(client.sslHandle, ret)
             if err != SSL_ERROR_WANT_ACCEPT:
               case err
               of SSL_ERROR_ZERO_RETURN:
@@ -993,7 +993,7 @@ when false: #defineSsl:
                 raiseSSLError("Unknown error")
           client.sslNoHandshake = false
 
-    if client.isSsl and client.sslNoHandshake:
+    if client.isSSL and client.sslNoHandshake:
       doHandshake()
       return AcceptSuccess
     else:
@@ -1039,8 +1039,8 @@ proc close*(socket: Socket) =
             socketError(socket, res)
   finally:
     when defineSsl:
-      if socket.isSsl and socket.sslHandle != nil:
-        SSL_free(socket.sslHandle)
+      if socket.isSSL and socket.sslHandle != nil:
+        SSLFree(socket.sslHandle)
         socket.sslHandle = nil
 
     socket.fd.close()
@@ -1119,7 +1119,7 @@ when defined(ssl):
     ## and the server that ``socket`` is connected to.
     ##
     ## Throws SslError if ``socket`` is not an SSL socket.
-    if socket.isSsl:
+    if socket.isSSL:
       return not socket.sslNoHandshake
     else:
       raiseSSLError("Socket is not an SSL socket.")
@@ -1131,7 +1131,7 @@ proc hasDataBuffered*(s: Socket): bool =
     result = s.bufLen > 0 and s.currPos != s.bufLen
 
   when defineSsl:
-    if s.isSsl and not result:
+    if s.isSSL and not result:
       result = s.sslHasPeekChar
 
 proc select(readfd: Socket, timeout = 500): int =
@@ -1207,7 +1207,7 @@ proc recv*(socket: Socket, data: pointer, size: int): int {.tags: [
     result = read
   else:
     when defineSsl:
-      if socket.isSsl:
+      if socket.isSSL:
         if socket.sslHasPeekChar: # TODO: Merge this peek char mess into uniRecv
           copyMem(data, addr(socket.sslPeekChar), 1)
           socket.sslHasPeekChar = false
@@ -1246,11 +1246,11 @@ proc waitFor(socket: Socket, waited: var Duration, timeout, size: int,
       raise newException(TimeoutError, "Call to '" & funcName & "' timed out.")
 
     when defineSsl:
-      if socket.isSsl:
+      if socket.isSSL:
         if socket.hasDataBuffered:
           # sslPeekChar is present.
           return 1
-        let sslPending = SSL_pending(socket.sslHandle)
+        let sslPending = SSLPending(socket.sslHandle)
         if sslPending != 0:
           return min(sslPending, size)
 
@@ -1352,7 +1352,7 @@ proc peekChar(socket: Socket, c: var char): int {.tags: [ReadIOEffect].} =
     c = socket.buffer[socket.currPos]
   else:
     when defineSsl:
-      if socket.isSsl:
+      if socket.isSSL:
         if not socket.sslHasPeekChar:
           result = uniRecv(socket, addr(socket.sslPeekChar), 1, 0'i32)
           socket.sslHasPeekChar = true
@@ -1584,7 +1584,7 @@ proc sendTo*(socket: Socket, address: string, port: Port,
 proc isSsl*(socket: Socket): bool =
   ## Determines whether ``socket`` is a SSL socket.
   when defineSsl:
-    result = socket.isSsl
+    result = socket.isSSL
   else:
     result = false
 
@@ -1782,7 +1782,7 @@ proc connect*(socket: Socket, address: string,
   if not success: raiseOSError(lastError)
 
   when defineSsl:
-    if socket.isSsl:
+    if socket.isSSL:
       # RFC3546 for SNI specifies that IP addresses are not allowed.
       if not isIpAddress(address):
         # Discard result in case OpenSSL version doesn't support SNI, or we're
@@ -1850,7 +1850,7 @@ proc connect*(socket: Socket, address: string, port = Port(0),
     if res != 0:
       raiseOSError(OSErrorCode(res))
     when defineSsl and not defined(nimdoc):
-      if socket.isSsl:
+      if socket.isSSL:
         socket.fd.setBlocking(true)
         doAssert socket.gotHandshake()
   socket.fd.setBlocking(true)
diff --git a/testament/backend.nim b/testament/backend.nim
index 0a6d7d8b9..c2658d6a0 100644
--- a/testament/backend.nim
+++ b/testament/backend.nim
@@ -23,8 +23,8 @@ var
 proc getMachine*(): MachineId =
   var name = execProcess("hostname").string.strip
   if name.len == 0:
-    name = when defined(posix): getEnv("HOSTNAME").string
-           else: getEnv("COMPUTERNAME").string
+    name = when defined(posix): getenv("HOSTNAME").string
+           else: getenv("COMPUTERNAME").string
   if name.len == 0:
     quit "cannot determine the machine name"
 
diff --git a/testament/categories.nim b/testament/categories.nim
index 760c3c5be..e44c3729f 100644
--- a/testament/categories.nim
+++ b/testament/categories.nim
@@ -297,7 +297,7 @@ proc testNimInAction(r: var TResults, cat: Category, options: string) =
     testSpec r, makeTest(filename, options, cat), {targetJS}
 
   template testCPP(filename: untyped) =
-    testSpec r, makeTest(filename, options, cat), {targetCpp}
+    testSpec r, makeTest(filename, options, cat), {targetCPP}
 
   let tests = [
     "niminaction/Chapter1/various1",
@@ -384,7 +384,7 @@ proc findMainFile(dir: string): string =
       elif file.endsWith(".nim"):
         if result.len == 0: result = file
         inc nimFiles
-  if nimFiles != 1: result.setLen(0)
+  if nimFiles != 1: result.setlen(0)
 
 proc manyLoc(r: var TResults, cat: Category, options: string) =
   for kind, dir in os.walkDir("tests/manyloc"):
@@ -567,7 +567,7 @@ const MegaTestCat = "megatest"
 
 proc `&.?`(a, b: string): string =
   # candidate for the stdlib?
-  result = if b.startsWith(a): b else: a & b
+  result = if b.startswith(a): b else: a & b
 
 proc processSingleTest(r: var TResults, cat: Category, options, test: string) =
   let test = testsDir &.? cat.string / test
diff --git a/testament/htmlgen.nim b/testament/htmlgen.nim
index 8e58dd95e..002bd83bc 100644
--- a/testament/htmlgen.nim
+++ b/testament/htmlgen.nim
@@ -63,7 +63,7 @@ proc generateTestResultPanelPartial(outfile: File, testResultRow: JsonNode) =
 
 type
   AllTests = object
-    data: JsonNode
+    data: JSonNode
     totalCount, successCount, ignoredCount, failedCount: int
     successPercentage, ignoredPercentage, failedPercentage: BiggestFloat
 
diff --git a/testament/testament.nim b/testament/testament.nim
index 109ce4ed9..a798544ec 100644
--- a/testament/testament.nim
+++ b/testament/testament.nim
@@ -97,7 +97,7 @@ proc getFileDir(filename: string): string =
   if not result.isAbsolute():
     result = getCurrentDir() / result
 
-proc execCmdEx2(command: string, args: openArray[string]; workingDir, input: string = ""): tuple[
+proc execCmdEx2(command: string, args: openarray[string]; workingDir, input: string = ""): tuple[
                 cmdLine: string,
                 output: TaintedString,
                 exitCode: int] {.tags:
@@ -473,7 +473,7 @@ proc testSpecHelper(r: var TResults, test: TTest, expected: TSpec,
           if exitCode != expected.exitCode:
             r.addResult(test, target, "exitcode: " & $expected.exitCode,
                               "exitcode: " & $exitCode & "\n\nOutput:\n" &
-                              bufB, reExitcodesDiffer)
+                              bufB, reExitCodesDiffer)
           elif (expected.outputCheck == ocEqual and expected.output != bufB) or
               (expected.outputCheck == ocSubstr and expected.output notin bufB):
             given.err = reOutputsDiffer
@@ -536,7 +536,7 @@ proc testC(r: var TResults, test: TTest, action: TTestAction) =
   elif action == actionRun:
     let exeFile = changeFileExt(test.name, ExeExt)
     var (_, exitCode) = execCmdEx(exeFile, options = {poStdErrToStdOut, poUsePath})
-    if exitCode != 0: given.err = reExitcodesDiffer
+    if exitCode != 0: given.err = reExitCodesDiffer
   if given.err == reSuccess: inc(r.passed)
 
 proc testExec(r: var TResults, test: TTest) =
@@ -549,7 +549,7 @@ proc testExec(r: var TResults, test: TTest) =
   if errC == 0:
     given.err = reSuccess
   else:
-    given.err = reExitcodesDiffer
+    given.err = reExitCodesDiffer
     given.msg = outp.string
 
   if given.err == reSuccess: inc(r.passed)
@@ -613,8 +613,8 @@ proc loadSkipFrom(name: string): seq[string] =
       result.add sline
 
 proc main() =
-  os.putEnv "NIMTEST_COLOR", "never"
-  os.putEnv "NIMTEST_OUTPUT_LVL", "PRINT_FAILURES"
+  os.putenv "NIMTEST_COLOR", "never"
+  os.putenv "NIMTEST_OUTPUT_LVL", "PRINT_FAILURES"
 
   azure.init()
   backend.open()
@@ -627,7 +627,7 @@ proc main() =
 
   var p = initOptParser()
   p.next()
-  while p.kind in {cmdLongOption, cmdShortOption}:
+  while p.kind in {cmdLongoption, cmdShortOption}:
     case p.key.string.normalize
     of "print", "verbose": optPrintResults = true
     of "failing": optFailing = true
diff --git a/tools/nimfind.nim b/tools/nimfind.nim
index 05980d740..6a4585c7e 100644
--- a/tools/nimfind.nim
+++ b/tools/nimfind.nim
@@ -182,10 +182,10 @@ proc processCmdLine*(pass: TCmdLinePass, cmd: string; conf: ConfigRef) =
     parseopt.next(p)
     case p.kind
     of cmdEnd: break
-    of cmdLongOption, cmdShortOption:
+    of cmdLongoption, cmdShortOption:
       case p.key.normalize
       of "help", "h":
-        stdout.writeLine(Usage)
+        stdout.writeline(Usage)
         quit()
       of "project":
         conf.projectName = p.val
@@ -215,7 +215,7 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
   self.initDefinesProg(conf, "nimfind")
 
   if paramCount() == 0:
-    stdout.writeLine(Usage)
+    stdout.writeline(Usage)
     return
 
   self.processCmdLineAndProjectPath(conf)
@@ -231,4 +231,4 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
 
   discard self.loadConfigsAndRunMainCommand(cache, conf)
 
-handleCmdLine(newIdentCache(), newConfigRef())
+handleCmdline(newIdentCache(), newConfigRef())