Wednesday, April 27, 2022

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

Issue

Should the name of command line options for a program in a POSIX-style operating system be underscore-style, like

--cure_world_hunger

or maybe some other style?

--cureworldhunger
--cure-world-hunger
--cureWorldHunger

What's most common? What's better style? What's more Bash-friendly (if such a thing exist)?


Solution

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


Answered By - Niko
Answer Checked By - Terry (WPSolving Volunteer)