如何隐藏所有 Nimble 和 Nim 输出(包括错误)?
如何隐藏所有 Nimble 和 Nil 输出(包括错误)?
我使用了这个命令nimble build --silent
,但是当出现错误时它仍然会抛出错误。
我怎样才能禁用它?
How can I hide all Nimble and Nil outputs including errors?
I used this command nimble build --silent
, but it still throws errors when there are errors.
How can I disable that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来好像您想要完成的是隐藏
nim
和nimble
的所有输出。虽然尚不清楚为什么需要这样做,但您可以非常轻松地隐藏所有输出。这不限于 nim 和 nimble,而是任何程序。
尽管它确实在某种程度上取决于您运行命令的位置。
在 linux / sh 上,您可以通过重定向到
/dev/null
来隐藏输出:在 Windows 上,在 cmd 或批处理文件中,您会:
而在 powershell 上您会:
在这种情况下实际发生的是stdout 和 stderr 正在被替换。这使得写入这些流的内容永远不会被实际输出。如果您只想暂时隐藏它们,但稍后查看/检查输出,您也可以替换
/dev/null
、NUL
或$null
带有文件路径,输出将作为文件写入其中。It sounds as though, what you want to accomplish is to hide all output from
nim
andnimble
.While it's unclear why this would be desirable, you can hide all outputs quite easily. This isn't restricted to nim and nimble, but any program.
Though it does somewhat depend on where you are running the command.
On linux / sh, you can hide outputs by redirecting to
/dev/null
:On windows, in cmd or batch files, you would:
whereas on powershell you would:
What actually happens in that case is that stdout and stderr are being replaced. This makes it so that what is being written to these streams is never actually outputed. If you only wanted to temporarily hide them, but see/check the outputs later, you could also substitute
/dev/null
,NUL
or$null
with a file path, which is where the output would be written to as a file.