diff options
-rw-r--r-- | compiler/commands.nim | 1 | ||||
-rw-r--r-- | compiler/main.nim | 1 | ||||
-rw-r--r-- | compiler/nim.nim | 3 | ||||
-rw-r--r-- | compiler/options.nim | 2 | ||||
-rw-r--r-- | compiler/scriptconfig.nim | 1 |
5 files changed, 6 insertions, 2 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim index 4346694f8..14141696f 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -776,6 +776,7 @@ proc processArgument*(pass: TCmdLinePass; p: OptParser; # nim filename.nims is the same as "nim e filename.nims": if p.key.endswith(".nims"): config.command = "e" + incl(config.globalOptions, optWasNimscript) config.projectName = unixToNativePath(p.key) config.arguments = cmdLineRest(p) result = true diff --git a/compiler/main.nim b/compiler/main.nim index 6c8b0343e..853bfb4f6 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -265,6 +265,7 @@ proc mainCommand*(graph: ModuleGraph) = conf.cmd = cmdInteractive commandInteractive(graph) of "e": + incl conf.globalOptions, optWasNimscript commandEval(graph, mainCommandArg(conf)) of "nop", "help": # prevent the "success" message: diff --git a/compiler/nim.nim b/compiler/nim.nim index 5f3347255..1c4dbd3be 100644 --- a/compiler/nim.nim +++ b/compiler/nim.nim @@ -54,7 +54,8 @@ proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) = of cmdArgument: if processArgument(pass, p, argsCount, config): break if pass == passCmd2: - if optRun notin config.globalOptions and config.arguments.len > 0 and config.command.normalize != "run": + if {optRun, optWasNimscript} * config.globalOptions == {} and + config.arguments.len > 0 and config.command.normalize notin ["run", "e"]: rawMessage(config, errGenerated, errArgsNeedRunOption) proc handleCmdLine(cache: IdentCache; conf: ConfigRef) = diff --git a/compiler/options.nim b/compiler/options.nim index 5f152ed49..4e8ae9d1f 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -45,7 +45,7 @@ type # please make sure we have under 32 options TOptions* = set[TOption] TGlobalOption* = enum # **keep binary compatible** gloptNone, optForceFullMake, - optDeadCodeElimUnused, # deprecated, always on + optWasNimscript, optListCmd, optCompileOnly, optNoLinking, optCDebug, # turn on debugging information optGenDynLib, # generate a dynamic library diff --git a/compiler/scriptconfig.nim b/compiler/scriptconfig.nim index f94533177..2040f9d21 100644 --- a/compiler/scriptconfig.nim +++ b/compiler/scriptconfig.nim @@ -123,6 +123,7 @@ proc setupVM*(module: PSym; cache: IdentCache; scriptName: string; cbconf setCommand: conf.command = a.getString 0 let arg = a.getString 1 + incl(conf.globalOptions, optWasNimscript) if arg.len > 0: conf.projectName = arg let path = |