.SH COPYRIGHT
myapp is Copyright (c) 2007 Wiley Publishing, Inc.
This program is, free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along, with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA.
.SH BUGS
There probably are some, but we don't know what they are yet.
.SH AUTHORS
Neil Matthew and Rick Stones
Как видите, макрос вводится с помощью точки (.) в начале строки и, как правило, дается в сокращенном виде. 1 в конце первой строки — номер раздела руководства, в который помещается команда. Поскольку команды располагаются в разделе 1, именно туда мы и помещаем наше новое приложение.
Вы сможете сгенерировать собственное интерактивное руководство, изменив приведенную страницу и изучив исходный код других страниц. Можно также посмотреть в архиве на Web-странице http://www.tldp.org/ часть Linux Documentation Project (Проект документирования Linux) "Linux Man Page mini-HowTo" ("Краткое руководство по написанию страниц интерактивного руководства в Linux"), написанную Дженс Швейкхардт (Jens Schweikhardt).
Имея исходный текст страницы справочного руководства, можно обработать его утилитой groff. Команда groff обычно формирует текст ASCII (-Tascii) или выходной файл PostScript (-Tps). С помощью опции -man сообщите groff, что это страница интерактивного справочного руководства, и будут загружены специальные макроопределения, относящиеся к страницам интерактивного руководства.
$ groff -Tascii -man myapp.1
У этой команды следующий вывод.
MYAPP(1) MYAPP(1)
NAME
Myapp — A simple demonstration application that does very
little.
SYNOPSIS
myapp [-option ...]
DESCRIPTION
myapp is a complete application that does nothing useful.
It was written for demonstration purposes.
OPTIONS
It doesn't have any, but let's pretend, to make this temp-
late complete:
-option
If there was an option, it would not be -option.
RESOURCES
myapp uses almost no resources.
DIAGNOSTICS
The program shouldn't output anything, so if you find it
doing so there's probably something wrong. The return
value is zero.
SEE ALSO
The only other program we know with this little func-
tionality is the ubiquitous Hello World application.
COPYRIGHT
myapp is Copyright (c) 2007 Wiley Publishing, Inc.
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be