Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top