If the first character of optstring is a colon, silent error reporting is used.
最前面的冒号是用来屏蔽输出自带错误信息的。
该错误通常是静默的。
If not in silent mode, these errors cause a diagnostic error message and OPTARG is unset.
如果不是在静默模式,则这些错误将导致一条诊断错误消息而OPTARG不会被设置。
In silent mode, either of the following two error conditions may occur.
在静默模式下,可能出现以下两种错误情况。
Silent processing with log: The error table.
用日志悄悄地进行处理:错误表。
The leading colon in this example tells getopts to be silent and suppress the normal error messages, as this script will provide its own error handling.
此例中的前导冒号告诉getopts 保持静默(silent)并抑制正常的错误消息,因为此脚本将提供它自己的错误处理。
Perhaps silent failure or flag return values would be useful, or another sort of fallback operations for error cases.
无声故障或标志返回值可能会有用,或另一种用于错误例子的后退操作会有用。
Is there a way to silent raised error messages just for unit testing?
有没有一种办法来沉默了错误信息是单元测试?
Is there a way to silent raised error messages just for unit testing?
有没有一种办法来沉默了错误信息是单元测试?
应用推荐