0

Premise

Most of the long-form options in the various *nix tools use hyphens as word separators.

Examples

from man tr:

 --squeeze-repeats
 --truncate-set1

from man sudo:

--preserve-env
--set-home
--non-interactive

Many more examples could be given.

Question

Why does the option --add_extra_groups in adduser contain underscore rather than hyphen word delimiters? Even the other long-form options in adduser use hyphens:

SYNOPSIS
     adduser  [options] [--no-create-home] [--disabled-password] [--disabled-login] 
     [--add_extra_groups] [--encrypt-home] user

Is this just a typo that has become normalized over time, or is there some other explanation?

1

1 Answer 1

0

It's a typo, even if the option works anyway.

By standard, hyphens should be used to separate words, even if sometimes one can find underscores. For instance, here's what The GNU C Library Reference Manual says about long options:

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 to separate words.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .