better run also considers the command line; fixes #11719 [feature]

This commit is contained in:
Araq 2019-07-12 21:52:29 +02:00
commit d55cc0888d
3 changed files with 18 additions and 1 deletions

View file

@ -48,12 +48,20 @@ proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) =
case p.kind
of cmdEnd: break
of cmdLongOption, cmdShortOption:
config.commandLine.add " "
config.commandLine.add p.key
if p.val.len > 0:
config.commandLine.add ':'
config.commandLine.add p.val
if p.key == " ":
p.key = "-"
if processArgument(pass, p, argsCount, config): break
else:
processSwitch(pass, p, config)
of cmdArgument:
config.commandLine.add " "
config.commandLine.add p.key
if processArgument(pass, p, argsCount, config): break
if pass == passCmd2:
if {optRun, optWasNimscript} * config.globalOptions == {} and