diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-11-26 15:55:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-26 15:55:56 -0800 |
commit | 52829fc8d1324c8192bc1674ff47e504648675fa (patch) | |
tree | 83919f869c1a8d2d257e4543ac2125fa23c545f4 /compiler/nim.nim | |
parent | 9f1c5f64c5a9a3de5f4f39040b3df484de649ef2 (diff) | |
download | Nim-52829fc8d1324c8192bc1674ff47e504648675fa.tar.gz |
cmdline: improve command processing (#16056)
Diffstat (limited to 'compiler/nim.nim')
-rw-r--r-- | compiler/nim.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/nim.nim b/compiler/nim.nim index e3725f803..46654e352 100644 --- a/compiler/nim.nim +++ b/compiler/nim.nim @@ -64,7 +64,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", "r"]: + config.arguments.len > 0 and config.cmd notin {cmdTcc, cmdNimscript, cmdCrun}: rawMessage(config, errGenerated, errArgsNeedRunOption) proc handleCmdLine(cache: IdentCache; conf: ConfigRef) = @@ -86,19 +86,19 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) = #echo(GC_getStatistics()) if conf.errorCounter != 0: return when hasTinyCBackend: - if conf.cmd == cmdRun: + if conf.cmd == cmdTcc: tccgen.run(conf, conf.arguments) if optRun in conf.globalOptions: let output = conf.absOutFile case conf.cmd - of cmdCompileToBackend: + of cmdBackends, cmdTcc: var cmdPrefix = "" case conf.backend of backendC, backendCpp, backendObjc: discard of backendJs: cmdPrefix = findNodeJs() & " " else: doAssert false, $conf.backend execExternalProgram(conf, cmdPrefix & output.quoteShell & ' ' & conf.arguments) - of cmdDoc, cmdRst2html: + of cmdDocLike, cmdRst2html, cmdRst2tex: # bugfix(cmdRst2tex was missing) if conf.arguments.len > 0: # reserved for future use rawMessage(conf, errGenerated, "'$1 cannot handle arguments" % [$conf.cmd]) |