程序的菜单帮助语法 [英] Menu help syntax of a program
问题描述
是否有关于如何编写Linux上的程序的终端帮助菜单的一些规则或模式?
我通常使用这些参数:<?code> - 或 -h
或 -H
来显示我的程序的帮助,但有没有这个规矩呢?
输出为 - 帮助
是不是一个真正的菜单,只是一个帮助信息。
有一些编码规则,特别是 GNU编码标准指定一些关于 - 帮助
(也是 - 版本
)。我强烈建议,同时支持他们; 。帮助
的几个节目生气和GNU libc中提供了多种方式用于提供 - 帮助
。我建议寻找到 argp 的,但你可以使用的 getopt的。
Are there some rules or pattern on how to write the terminal help menu of a program on linux?
Usually I use these arguments: -?
or -h
or -H
to display the help of my program but is there a rule about that as well?
解决方案 The output for --help
is not really a menu, just a help message.
There are some coding rules, in particular the GNU coding standards specify something about --help
(and also --version
). I strongly suggest supporting both of them; as a user, I am pissed off by the few programs not understanding --help
.
And the GNU libc provides several ways for providing that --help
. I suggest looking into argp, but you could use getopt.
这篇关于程序的菜单帮助语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!