Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to silence Nim compile and run output?

Tags:

nim-lang

If I run nim c -r test.nim the following code in Nim

echo "Hi"

It would print the result with additional information

$ 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

Is there a way to tell it to print only the result, the

Hi
like image 253
Alex Craft Avatar asked Oct 15 '25 17:10

Alex Craft


1 Answers

You can use the --hints:on|off|list option:

nim c -r --hints:off test.nim

Note that warnings and errors will still be reported when hints are turned off. You can turn off warnings too with --warnings:on|off|list. These and other compiler switches are described here.

like image 168
ad absurdum Avatar answered Oct 18 '25 19:10

ad absurdum



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!