如何清除 Nim 中的错误消息?沉默提示?

How to clean error message in Nim? Silence hints?

这个错误代码

import sequtils, sugar, yaml

let a: int
a = ""

产生巨大的错误信息

$ nimble run
  Verifying dependencies for nim@1
      Info: Dependency on yaml@any version already satisfied
  Verifying dependencies for yaml@0.14.0
   Building nim/app using c backend
       Tip: 3 messages have been suppressed, use --verbose to show them.
     Error: Build failed for package: nim
        ... Details:
        ... Execution failed with exit code 1
        ... Command: "/usr/local/Cellar/nim/1.2.6/nim/bin/nim" c --noNimblePath -d:NimblePkgVersion=1 --path:"/Users/alex/.nimble/pkgs/yaml-0.14.0"  -o:"/alex/projects/alien/old/nim/app" "/alex/projects/alien/old/nim/src/app.nim"
        ... Output: Hint: used config file '/usr/local/Cellar/nim/1.2.6/nim/config/nim.cfg' [Conf]
        ... Hint: system [Processing]
        ... Hint: widestrs [Processing]
        ... Hint: io [Processing]
        ... Hint: app [Processing]
        ... Hint: base [Processing]
        ... Hint: sequtils [Processing]
        ... Hint: macros [Processing]
        ... Hint: sugar [Processing]
        ... Hint: typetraits [Processing]
        ... Hint: underscored_calls [Processing]
        ... Hint: yaml [Processing]
        ... Hint: dom [Processing]
        ... Hint: tables [Processing]
        ... Hint: hashes [Processing]
        ... Hint: math [Processing]
        ... Hint: bitops [Processing]
        ... Hint: algorithm [Processing]
        ... Hint: streams [Processing]
        ... Hint: sets [Processing]
        ... Hint: strutils [Processing]
        ... Hint: parseutils [Processing]
        ... Hint: unicode [Processing]
        ... Hint: stream [Processing]
        ... Hint: internal [Processing]
        ... Hint: taglib [Processing]
        ... Hint: serialization [Processing]
        ... Hint: times [Processing]
        ... Hint: options [Processing]
        ... Hint: posix [Processing]
        ... Hint: parser [Processing]
        ... Hint: lex [Processing]
        ... Hint: lexbase [Processing]
        ... Hint: presenter [Processing]
        ... Hint: deques [Processing]
        ... Hint: hints [Processing]
        ... Hint: annotations [Processing]
        ... Hint: tojson [Processing]
        ... Hint: json [Processing]
        ... Hint: parsejson [Processing]
        ... /alex/projects/nim/src/test.nim(3, 5) Error: 'let' symbol requires an initialization

是否可以将非必要的输出静音并只显示错误消息?喜欢

        ... /alex/projects/nim/src/test.nim(3, 5) Error: 'let' symbol requires an initialization

这部分有帮助 nimble --hints:off run

要使用编译器获得该行为,您将使用两个参数:

nim c --hints:off --verbosity:0 -r something.nim

您可以将其添加到 a compiler configuration file,如果这是您唯一需要的,则不需要 nimble。

关于 nimble,来自 it's changelog it seems the verbosity of commands has changed over time,看看相同的编译器参数是否适用于 nimble,如果不行,请创建一个问题来请求这种行为。