diff options
-rw-r--r-- | compiler/cmdlinehelper.nim | 2 | ||||
-rw-r--r-- | compiler/commands.nim | 4 | ||||
-rw-r--r-- | compiler/msgs.nim | 2 | ||||
-rw-r--r-- | compiler/options.nim | 2 |
4 files changed, 3 insertions, 7 deletions
diff --git a/compiler/cmdlinehelper.nim b/compiler/cmdlinehelper.nim index 9df6d37e0..a03899071 100644 --- a/compiler/cmdlinehelper.nim +++ b/compiler/cmdlinehelper.nim @@ -27,9 +27,7 @@ proc initDefinesProg*(self: NimProg, conf: ConfigRef, name: string) = defineSymbol conf.symbols, name proc processCmdLineAndProjectPath*(self: NimProg, conf: ConfigRef) = - conf.isCmdLine = true self.processCmdLine(passCmd1, "", conf) - conf.isCmdLine = false if self.supportsStdinFile and conf.projectName == "-": handleStdinInput(conf) elif conf.projectName != "": diff --git a/compiler/commands.nim b/compiler/commands.nim index 76203762c..d2f1f78b3 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -204,7 +204,7 @@ proc processSpecificNote*(arg: string, state: TSpecialWord, pass: TCmdLinePass, incl(conf.notes, n) incl(conf.mainPackageNotes, n) incl(conf.enableNotes, n) - if conf.isCmdLine: + if pass == passCmd1: incl(conf.cmdLineNotes, n) excl(conf.cmdLineDisabledNotes, n) of "off": @@ -212,7 +212,7 @@ proc processSpecificNote*(arg: string, state: TSpecialWord, pass: TCmdLinePass, excl(conf.mainPackageNotes, n) incl(conf.disableNotes, n) excl(conf.foreignPackageNotes, n) - if conf.isCmdLine: + if pass == passCmd1: incl(conf.cmdLineDisabledNotes, n) excl(conf.cmdLineNotes, n) else: localError(conf, info, errOnOrOffExpectedButXFound % arg) diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 7fa8e8aef..197295249 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -421,7 +421,7 @@ proc rawMessage*(conf: ConfigRef; msg: TMsgKind, args: openArray[string]) = if msg in conf.cmdLineDisabledNotes: return # eg: `--hints:conf:off` passed on cmdline # handle `--hints:off` (regardless of cmdline/cfg file) # handle `--hints:conf:on` on cmdline - if not conf.hasHint(msg) and not (optHints in conf.options and msg in conf.cmdLineNotes)): return + if not conf.hasHint(msg) and not (optHints in conf.options and msg in conf.cmdLineNotes): return title = HintTitle color = HintColor if msg != hintUserRaw: kind = HintsToStr[ord(msg) - ord(hintMin)] diff --git a/compiler/options.nim b/compiler/options.nim index fc37979e2..9d073ce45 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -288,7 +288,6 @@ type structuredErrorHook*: proc (config: ConfigRef; info: TLineInfo; msg: string; severity: Severity) {.closure, gcsafe.} cppCustomNamespace*: string - isCmdLine*: bool # whether we are currently processing cmdline args, not cfg files proc hasHint*(conf: ConfigRef, note: TNoteKind): bool = optHints in conf.options and note in conf.notes @@ -394,7 +393,6 @@ proc newConfigRef*(): ConfigRef = arguments: "", suggestMaxResults: 10_000, maxLoopIterationsVM: 10_000_000, - isCmdLine: false, ) setTargetFromSystem(result.target) # enable colors by default on terminals |