posix - --help 标志是 POSIX 标准/建议吗?

标签 posix

如果我有一个通过 shell 运行的应用程序,是否有 POSIX 文档说 --help需要支持吗?我会这么认为,因为这似乎是最流行的终端应用程序(GNU 工具等)中的标准做法。

我很好奇我是否可以使用“--help”选项的存在或缺失作为寻找 POSIX 兼容/不兼容命令的试金石。

最佳答案

POSIX 不强制--help :http://pubs.opengroup.org/onlinepubs/009695399/utilities/ls.html

其实好像POSIX guidelines建议避免不是单个字符的选项(虽然它不被禁止,只是一个指导方针):

Guideline 3: Each option name should be a single alphanumeric character (the alnum character classification) from the portable character set. The -W (capital-W) option shall be reserved for vendor options.

Multi-digit options should not be allowed.

关于posix - --help 标志是 POSIX 标准/建议吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16820245/

相关文章:

c - posix 的线程优先级

c - getaddrinfo_a 线程安全吗?

c - 正确的 fork() 和 pipe() 用于有多个 child 的单亲。我该怎么做?

c - 尽管管道关闭,读取仍继续阻塞

c - UNIX/Linux 信号处理 : SIGEV_THREAD

linux - *.1.gz 和 *.1posix.gz 文件之间的差异(UNIX 联机帮助页)

c++ - pthread_mutex_destroy : why is it returning EBUSY?

c - POSIX Bonjour/mDNSResponder 测试示例在 Ubuntu 上报告 "bind: Address already in use",但在 Debian 上则不然

c - 在定时器 fd 上执行 lseek 时出错

c - 使用 pthread 和信号打印文本文件