NimScript: setCommand takes an optional project filename
This commit is contained in:
parent
27bdf5c45c
commit
1b7d8246c1
3 changed files with 9 additions and 2 deletions
|
|
@ -48,7 +48,7 @@ proc handleCmdLine() =
|
||||||
gProjectFull = canonicalizePath(gProjectName)
|
gProjectFull = canonicalizePath(gProjectName)
|
||||||
except OSError:
|
except OSError:
|
||||||
gProjectFull = gProjectName
|
gProjectFull = gProjectName
|
||||||
var p = splitFile(gProjectFull)
|
let p = splitFile(gProjectFull)
|
||||||
gProjectPath = p.dir
|
gProjectPath = p.dir
|
||||||
gProjectName = p.name
|
gProjectName = p.name
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,13 @@ proc setupVM*(module: PSym; scriptName: string): PEvalContext =
|
||||||
setResult(a, strutils.cmpIgnoreCase(a.getString 0, a.getString 1))
|
setResult(a, strutils.cmpIgnoreCase(a.getString 0, a.getString 1))
|
||||||
cbconf setCommand:
|
cbconf setCommand:
|
||||||
options.command = a.getString 0
|
options.command = a.getString 0
|
||||||
|
let arg = a.getString 1
|
||||||
|
if arg.len > 0:
|
||||||
|
gProjectName = arg
|
||||||
|
try:
|
||||||
|
gProjectFull = canonicalizePath(gProjectPath / gProjectName)
|
||||||
|
except OSError:
|
||||||
|
gProjectFull = gProjectName
|
||||||
cbconf getCommand:
|
cbconf getCommand:
|
||||||
setResult(a, options.command)
|
setResult(a, options.command)
|
||||||
cbconf switch:
|
cbconf switch:
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ proc getCommand*(): string =
|
||||||
## "c", "js", "build", "help".
|
## "c", "js", "build", "help".
|
||||||
builtin
|
builtin
|
||||||
|
|
||||||
proc setCommand*(cmd: string) =
|
proc setCommand*(cmd: string; project="") =
|
||||||
## Sets the Nim command that should be continued with after this Nimscript
|
## Sets the Nim command that should be continued with after this Nimscript
|
||||||
## has finished.
|
## has finished.
|
||||||
builtin
|
builtin
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue