Should command line options in POSIX-style operating systems be underscore style? [closed] Should command line options in POSIX-style operating systems be underscore style? [closed] bash bash

Should command line options in POSIX-style operating systems be underscore style? [closed]


Underscore is not a good idea, sometimes it gets "eaten" by a terminal border and thus look like a space.

The easiest to read, and most standard way is to use a dash:

--cure-world-hunger


Always hyphens! Let's get a reputed reference: the Gnu style guide:

GNU adds long options to these conventions. Long options consist of‘--’ followed by a name made of alphanumeric characters and dashes.Option names are typically one to three words long, with hyphens toseparate words. Users can abbreviate the option names as long as theabbreviations are unique.

Another problem with underscores is that if the documentation is linked in a HTML document, the underscore will be "eaten" by the link underline.


The double dash prefix is a GNU convention I believe. Check out getopt_long(3) man page on the GNU/Linux Operating System.