Search code examples
posix

Is --help Flag A POSIX Standard/Recommendation?


If I have an application that runs via a shell, is there POSIX documentation that says --help support is required? I would think so, as this seems to be a standard practice among the most popular terminal applications (GNU tools, etc).

I'm mostly curious if I can use the presence or lack of a "--help" option as a litmus test for finding POSIX-compliant/non-compliant commands.


Solution

  • POSIX doesn't mandate --help: http://pubs.opengroup.org/onlinepubs/009695399/utilities/ls.html

    In fact, it seems that POSIX guidelines suggest avoiding options that aren't a single character (though it's not prohibited, just a guideline):

    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.