什么是" POSIX定义的格式"对于命令行错误信息?哪个标准? [英] What is the "POSIX-defined format" for command-line error messages? Which standard?

查看:404
本文介绍了什么是" POSIX定义的格式"对于命令行错误信息?哪个标准?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ruby-doc.org的页面
我发现下面的有关命令行选项/参数解析(getopt的库):

On ruby-doc.org page I found the following about command-line options/arguments parsing (getopt library):

返回POSIX定义格式相应的错误信息。如果没有出现错误,返回nil。

Return the appropriate error message in POSIX-defined format. If no error has occurred, returns nil.

什么是命令行的错误消息POSIX定义的格式?这POSIX标准是什么呢?

What is POSIX-defined format for command-line error messages? Which POSIX standard is it?

编辑:

我要澄清,我感兴趣的是标准/推荐的错误消息时
解析命令行参数/选项。

I must clarify that I was interested in standard/recommended error messages when parsing command line arguments/options.

在下面的链接(答案)我发现只有提的这个错误格式的getopt:

In the links below (answers) I found only mentioning this error format for getopt:

"%s: illegal option -- %c\n", <program name>, <option character>

"%s: option requires an argument -- %c\n", <program name>, <option character>

这一切是它?

推荐答案

IEEE标准1003.1它。请参见 errno.h中 错误号。又称POSIX.1-2008,和早期版本(见维基有关章节的详细信息,年等)。

IEEE Std 1003.1 it is. See errno.h, Error Numbers. Also known as POSIX.1-2008, and earlier revisions (see wiki for more details on sections, years etc).

请注意,系统可能有扩展设置错误编号和与之相关的消息。例如,Linux支持由C99定义的错误数字。有可能是特定于实现的误差为好。下面就是Linux的 错误号。 ^ h ,以供参考。

Note that systems are likely to have extended set of error numbers and messages associated with them. For example, Linux supports error numbers defined by C99. There could be implementation-specific errors as well. Here is Linux's errno.h for reference.

这篇关于什么是&QUOT; POSIX定义的格式&QUOT;对于命令行错误信息?哪个标准?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆