refactoring: move 'argument' global into config object

This commit is contained in:
Andreas Rumpf 2018-04-24 11:58:18 +02:00
commit b503ca03f6
4 changed files with 8 additions and 11 deletions

View file

@ -80,7 +80,7 @@ proc handleCmdLine(cache: IdentCache; config: ConfigRef) =
if msgs.gErrorCounter == 0:
when hasTinyCBackend:
if gCmd == cmdRun:
tccgen.run(commands.arguments)
tccgen.run(config.arguments)
if optRun in gGlobalOptions:
if gCmd == cmdCompileToJS:
var ex: string
@ -89,7 +89,7 @@ proc handleCmdLine(cache: IdentCache; config: ConfigRef) =
else:
ex = quoteShell(
completeCFilePath(changeFileExt(gProjectFull, "js").prependCurDir))
execExternalProgram(findNodeJs() & " " & ex & ' ' & commands.arguments)
execExternalProgram(findNodeJs() & " " & ex & ' ' & config.arguments)
else:
var binPath: string
if options.outFile.len > 0:
@ -99,7 +99,7 @@ proc handleCmdLine(cache: IdentCache; config: ConfigRef) =
# Figure out ourselves a valid binary name.
binPath = changeFileExt(gProjectFull, ExeExt).prependCurDir
var ex = quoteShell(binPath)
execExternalProgram(ex & ' ' & commands.arguments)
execExternalProgram(ex & ' ' & config.arguments)
when declared(GC_setMaxPause):
GC_setMaxPause 2_000