程序的菜单帮助语法 [英] Menu help syntax of a program

查看:137
本文介绍了程序的菜单帮助语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有关于如何编写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屋!

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