On Thu, May 30, 2019 at 10:16:12PM +1000, Stephen Gregoratto wrote:
> When I'm writing new manpages, I like to draw inspiration from the
> documentation of similar programs. The problem is that many manpages
> have different ways of saying the same thing, probably due to their
> authors and time period they were written in.
> 
> So, I'd like to ask what your preferred choice is of the following
> common idioms I keep finding:
[cut]
> 3. Program arguments
> 
> Is it:
>   Argument
>     echo(1)
>   Operand
>     printf(1), also echo(1)?

An argument to a command can be one of three things:

1. An option
2. An option-argument
3. An operand

An option is an argument that starts with a dash.  An option-argument is
an argument to an option that takes an argument.   An operand is an
argument that is not an option or an option-argument.

Example:

    man -M path ls

* -M is an option
* path is an option-argument to the -M option
* ls is an operand since it's neither an option nor an option-argument.

POSIX:

Argument: "In the shell command language, a parameter passed to a
utility as the equivalent of a single string in the argv array created
by one of the exec functions. An argument is one of the options,
option-arguments, or operands following the command name."

Option: "An argument to a command that is generally used to specify
changes in the utility's default behavior."

Option-argument: "A parameter that follows certain options. In some
cases an option-argument is included within the same argument string as
the option-in most cases it is the next argument."

Operand: "An argument to a command that is generally used as an object
supplying information to a utility necessary to complete its processing.
Operands generally follow the options in a command line."


https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html



-- 
Kusalananda
Sweden

Reply via email to