summary refs log tree commit diff stats
path: root/drnim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-11-26 15:55:56 -0800
committerGitHub <noreply@github.com>2020-11-26 15:55:56 -0800
commit52829fc8d1324c8192bc1674ff47e504648675fa (patch)
tree83919f869c1a8d2d257e4543ac2125fa23c545f4 /drnim
parent9f1c5f64c5a9a3de5f4f39040b3df484de649ef2 (diff)
downloadNim-52829fc8d1324c8192bc1674ff47e504648675fa.tar.gz
cmdline: improve command processing (#16056)
Diffstat (limited to 'drnim')
-rw-r--r--drnim/drnim.nim6
1 files changed, 2 insertions, 4 deletions
diff --git a/drnim/drnim.nim b/drnim/drnim.nim
index d68175c83..f2a20fa62 100644
--- a/drnim/drnim.nim
+++ b/drnim/drnim.nim
@@ -1223,9 +1223,7 @@ proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) =
   var argsCount = 1
 
   config.commandLine.setLen 0
-  config.command = "check"
-  config.cmd = cmdCheck
-
+  config.setCmd cmdCheck
   while true:
     parseopt.next(p)
     case p.kind
@@ -1253,7 +1251,7 @@ proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) =
       if processArgument(pass, p, argsCount, config): break
   if pass == passCmd2:
     if {optRun, optWasNimscript} * config.globalOptions == {} and
-        config.arguments.len > 0 and config.command.normalize notin ["run", "e"]:
+        config.arguments.len > 0 and config.cmd notin {cmdTcc, cmdNimscript}:
       rawMessage(config, errGenerated, errArgsNeedRunOption)
 
 proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =