如何使 Nim 编译和 运行 输出静音?
How to silence Nim compile and run output?
如果我在Nim运行nim c -r test.nim
下面的代码
echo "Hi"
它会打印带有附加信息的结果
$ nim c -r test.nim
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: test [Processing]
CC: stdlib_system.nim
CC: test.nim
Hint: [Link]
Hint: 14204 LOC; 0.898 sec; 18.598MiB peakmem; Debug build; proj: /Users/alex/tmp/nim/test.nim; out: /Users/alex/tmp/nim/test [SuccessX]
Hint: /Users/alex/tmp/nim/test
Hi
有没有办法告诉它只打印结果,
Hi
您可以使用 --hints:on|off|list
选项:
nim c -r --hints:off test.nim
请注意,关闭提示后仍会报告警告和错误。您也可以使用 --warnings:on|off|list
关闭警告。这些和其他编译器开关 are described here.
如果我在Nim运行nim c -r test.nim
下面的代码
echo "Hi"
它会打印带有附加信息的结果
$ nim c -r test.nim
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: test [Processing]
CC: stdlib_system.nim
CC: test.nim
Hint: [Link]
Hint: 14204 LOC; 0.898 sec; 18.598MiB peakmem; Debug build; proj: /Users/alex/tmp/nim/test.nim; out: /Users/alex/tmp/nim/test [SuccessX]
Hint: /Users/alex/tmp/nim/test
Hi
有没有办法告诉它只打印结果,
Hi
您可以使用 --hints:on|off|list
选项:
nim c -r --hints:off test.nim
请注意,关闭提示后仍会报告警告和错误。您也可以使用 --warnings:on|off|list
关闭警告。这些和其他编译器开关 are described here.