Menu help syntax of a program

浪子不回头ぞ 提交于 2019-12-11 10:44:23

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/18877063/menu-help-syntax-of-a-program

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!