Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a command line parameter that takes a number of flags afterwards, which I would like to have as a list inside the parameter list in the man page.

Currently I am simply making lines of Flag - Description (man page), but this is not ideal for the following reasons:

  • Doesn't indent wrapped lines. I can manually indent them but then I have to assume a set console width, which I don't want to do
  • Have to rely on double newlines to go to the next line, I'd rather have something like .TP.
share|improve this question
add comment

1 Answer

up vote 8 down vote accepted
  • Start the list with .RS, end with .RE.
  • Start list items with .IP followed by term. Enclose the term in double quotes if contains multiple words.
  • Put the description text in the next line after the list item start.
  • Is nestable, so the description may contain further lists.
  • Use \fB..\fP for bolding the term instead of .B. (Same for underline – use \fI..\fP instead of .I.)
.RS
.IP \fBA\fP
\- Flag 1
.IP \fBB\fP
\- Flag 2
.IP \fBC\fP
\- A slightly longer flag description that could take up more than the width
of the average console. In fact you'd need a very wide console to read all
this.
.RE

To increase your productivity I suggest to write your man pages in a friendlier format then convert them. Some suitable tools are enumerated in Can I create a man page for a script?.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.