diff options
author | Araq <rumpf_a@web.de> | 2015-09-04 12:22:12 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-09-04 12:22:23 +0200 |
commit | 178275f49403012ca3d774f8cadcc2836eea9508 (patch) | |
tree | 97b9f6260f9415bf92c3564f7c52f412efb81c4b /compiler | |
parent | 4fefdb4d916447e5378e8ac97d6cc6c20d4667b7 (diff) | |
download | Nim-178275f49403012ca3d774f8cadcc2836eea9508.tar.gz |
split os into os and ospaths parts; ospaths is available for NimScript; better NimScript support
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main.nim | 4 | ||||
-rw-r--r-- | compiler/scriptconfig.nim | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/compiler/main.nim b/compiler/main.nim index 7c043eb72..3bb6fc343 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -355,7 +355,9 @@ proc mainCommand* = gGlobalOptions.incl(optCaasEnabled) msgs.gErrorMax = high(int) # do not stop after first error serve(mainCommand) - of "nop", "help": discard + of "nop", "help": + # prevent the "success" message: + gCmd = cmdDump else: rawMessage(errInvalidCommandX, command) diff --git a/compiler/scriptconfig.nim b/compiler/scriptconfig.nim index 148a382c2..115ce940d 100644 --- a/compiler/scriptconfig.nim +++ b/compiler/scriptconfig.nim @@ -68,9 +68,20 @@ proc setupVM*(module: PSym; scriptName: string): PEvalContext = setResult(a, os.getCurrentDir()) cbos moveFile: os.moveFile(getString(a, 0), getString(a, 1)) + cbos copyFile: + os.copyFile(getString(a, 0), getString(a, 1)) cbos getLastModificationTime: setResult(a, toSeconds(getLastModificationTime(getString(a, 0)))) + cbconf getEnv: + setResult(a, os.getEnv(a.getString 0)) + cbconf existsEnv: + setResult(a, os.existsEnv(a.getString 0)) + cbconf dirExists: + setResult(a, os.dirExists(a.getString 0)) + cbconf fileExists: + setResult(a, os.fileExists(a.getString 0)) + cbconf thisDir: setResult(a, vthisDir) cbconf put: @@ -87,6 +98,8 @@ proc setupVM*(module: PSym; scriptName: string): PEvalContext = setResult(a, os.paramCount()) cbconf cmpIgnoreStyle: setResult(a, strutils.cmpIgnoreStyle(a.getString 0, a.getString 1)) + cbconf cmpIgnoreCase: + setResult(a, strutils.cmpIgnoreCase(a.getString 0, a.getString 1)) cbconf setCommand: options.command = a.getString 0 cbconf getCommand: |