Discussion:
Convention used by UNIX man pages
(too old to reply)
Generic Usenet Account
2009-11-19 20:11:11 UTC
Permalink
Apologies if this is OT!

I can almost swear that I had read somewhere that in UNIX online
documentation using man, the portion of the construct enclosed in ’[’
and ’]’ denotes an optional parameter while the portion of the
construct enclosed in ’<’ and ’>’ denotes a mandatory parameter.
Today I was challenged by a colleague that using ’<’ and '>' is not a
standard way of denoting mandatory parameters. According to my
colleague, mandatory parameters are just listed as is i.e. without any
delimiting angle brackets. Is this correct?

TIA
Zach
Lew Pitcher
2009-11-19 20:28:14 UTC
Permalink
On November 19, 2009 15:11, in comp.unix.programmer, Generic Usenet Account
Post by Generic Usenet Account
Apologies if this is OT!
I can almost swear that I had read somewhere that in UNIX online
documentation using man, the portion of the construct enclosed in ’[’
and ’]’ denotes an optional parameter while the portion of the
construct enclosed in ’<’ and ’>’ denotes a mandatory parameter.
Today I was challenged by a colleague that using ’<’ and '>' is not a
standard way of denoting mandatory parameters. According to my
colleague, mandatory parameters are just listed as is i.e. without any
delimiting angle brackets. Is this correct?
In my experience, the manual pages use a modified form of regular expression
to express parameters.

- plain text is used to indicate required values
italicized text is used to indicate required values that vary in text
underlined text is also used to indicate required values that vary

- Square brackets ([ ]) surround optional values
i.e.: passwd [name]

- Brace brackets ({ } ) surround required parameters that have alternate
values, with the Vertical Bar ( | ) separating each alternate value
i.e.: passwd {-l|-u|-d|-S|-e} login

- ellipsis ( ... ) is used to indicate values that repeat
i.e.: cdc -r SID [-m[mrlist] ] [ -y[comment] ] file ...

I /have/ seen textual variants (mostly in emails and usenet postings) that
surround some text with angle brackets (< >) to indicate the same sort of
thing that italics and underlines indicates in printed manual pages
--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576
Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/
---------- Slackware - Because I know what I'm doing. ------
Chris Friesen
2009-11-20 06:31:31 UTC
Permalink
Post by Generic Usenet Account
Apologies if this is OT!
I can almost swear that I had read somewhere that in UNIX online
documentation using man, the portion of the construct enclosed in ’[’
and ’]’ denotes an optional parameter while the portion of the
construct enclosed in ’<’ and ’>’ denotes a mandatory parameter.
I generally agree with Lew's reply, but I was under the impression that
curly brackets "{}" are used in conjuction with a vertical bar to
indicate cases where exactly one of the specified options may be used.
This may indicate alternate forms of the same thing. For instance, here
is the start of the usage string for "cpio":

cpio {-o|--create} [-0acvABLV]

In this case you must choose either -o or --create, as they mean the
same. Then you can choose zero or more of "0acvABLV".

Chris

Continue reading on narkive:
Loading...