This commit is contained in:
parent
ceb3d5ad68
commit
1f7c907e7d
2 changed files with 11 additions and 6 deletions
|
|
@ -29,10 +29,7 @@ proc initDefinesProg*(self: NimProg, conf: ConfigRef, name: string) =
|
||||||
proc processCmdLineAndProjectPath*(self: NimProg, conf: ConfigRef) =
|
proc processCmdLineAndProjectPath*(self: NimProg, conf: ConfigRef) =
|
||||||
self.processCmdLine(passCmd1, "", conf)
|
self.processCmdLine(passCmd1, "", conf)
|
||||||
if self.supportsStdinFile and conf.projectName == "-":
|
if self.supportsStdinFile and conf.projectName == "-":
|
||||||
conf.projectName = "stdinfile"
|
handleStdinInput(conf)
|
||||||
conf.projectFull = AbsoluteFile "stdinfile"
|
|
||||||
conf.projectPath = AbsoluteDir getCurrentDir()
|
|
||||||
conf.projectIsStdin = true
|
|
||||||
elif conf.projectName != "":
|
elif conf.projectName != "":
|
||||||
try:
|
try:
|
||||||
conf.projectFull = canonicalizePath(conf, AbsoluteFile conf.projectName)
|
conf.projectFull = canonicalizePath(conf, AbsoluteFile conf.projectName)
|
||||||
|
|
|
||||||
|
|
@ -369,6 +369,14 @@ proc dynlibOverride(conf: ConfigRef; switch, arg: string, pass: TCmdLinePass, in
|
||||||
expectArg(conf, switch, arg, pass, info)
|
expectArg(conf, switch, arg, pass, info)
|
||||||
options.inclDynlibOverride(conf, arg)
|
options.inclDynlibOverride(conf, arg)
|
||||||
|
|
||||||
|
proc handleStdinInput*(conf: ConfigRef) =
|
||||||
|
conf.projectName = "stdinfile"
|
||||||
|
conf.projectFull = conf.projectName.AbsoluteFile
|
||||||
|
conf.projectPath = AbsoluteDir getCurrentDir()
|
||||||
|
conf.projectIsStdin = true
|
||||||
|
if conf.outDir.isEmpty:
|
||||||
|
conf.outDir = getNimcacheDir(conf)
|
||||||
|
|
||||||
proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
|
proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
|
||||||
conf: ConfigRef) =
|
conf: ConfigRef) =
|
||||||
var
|
var
|
||||||
|
|
@ -861,8 +869,8 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
|
||||||
localError(conf, info, "unknown Nim version; currently supported values are: {1.0}")
|
localError(conf, info, "unknown Nim version; currently supported values are: {1.0}")
|
||||||
of "benchmarkvm":
|
of "benchmarkvm":
|
||||||
processOnOffSwitchG(conf, {optBenchmarkVM}, arg, pass, info)
|
processOnOffSwitchG(conf, {optBenchmarkVM}, arg, pass, info)
|
||||||
of "":
|
of "": # comes from "-" in for example: `nim c -r -` (gets stripped from -)
|
||||||
conf.projectName = "-"
|
handleStdinInput(conf)
|
||||||
else:
|
else:
|
||||||
if strutils.find(switch, '.') >= 0: options.setConfigVar(conf, switch, arg)
|
if strutils.find(switch, '.') >= 0: options.setConfigVar(conf, switch, arg)
|
||||||
else: invalidCmdLineOption(conf, pass, switch, info)
|
else: invalidCmdLineOption(conf, pass, switch, info)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue