BSD 4_3 development
[unix-history] / usr / contrib / help / help.n
CommitLineData
38d82d6f
C
1.TH HELP 1 "28 May 1984"
2.SH NAME
3help \- an easy way to find and use information
4.SH SYNOPSIS
5.B help [ \-d
6dirlist
7.B ] [ \-m
8key
9.B ] [ \-p
10prompt
11\fB] [ \-i ] [ \-n ] [ \-q ] [\fP
12topic
13.B [
14subtopic
15.B [
16subsubtopic
17\fB[ ... ] ] ] ]\fP
18.SH DESCRIPTION
19The primary purpose of
20.I help
21is to provide easy access to on-line documentation.
22In response to the command
23.BR help ,
24the user is placed in an interactive
25setting and presented with a list of topics and a set of instructions
26to perform on them.
27To bypass the interactive part and just display what is known about
28a topic, enter the topic name on the command line after \fBhelp\fP.
29.PP
30A topic is displayed by typing its name or a unique abbreviation,
31and topics may be requested and listed with numbers.
32Topics may be saved in a file or printed on the lineprinter.
33When you request a topic not on its list,
34.I help
35can search a set of indexes into its own files,
36the Unix Programmer's Manual, and various optional off-line sources.
37References found in this way can be displayed if material is available on-line.
38All topic requests, including ones which yield no useful information,
39are automatically recorded for later analysis by system maintainers.
40Any user may effectively add topics to \fBhelp\fP's knowledge base
41from that user's point of view by suitably defining the environment
42variable HELPPOOL.
43Thus each user can have a private cache of topic files accessible with
44.IR help .
45.PP
46In general the purpose of
47.I help
48is to provide a way to move around easily in a set of
49hierarchical databases, namely, one or more Unix file system subtrees.
50Although an inherent disadvantage of such databases is that data may be
51hidden within the hierarchies, the program
52overcomes this to some extent with its indexing feature.
53.I Help
54can be made to serve in special purpose
55applications without programmer intervention.
56.PP
57The following technical description may be of little interest to casual users.
58.PP
59The default knowledge base consists of the files and directories in
60the subtree /usr/lib/help/cat.
61If the environment variable HELPPOOL contains a list of directories
62(separated by spaces or colons), their contents are merged with the
63default list to form the knowledge base.
64The entire directory pool may be overridden by giving a
65directory list in
66.I dirlist
67after the
68.B \-d
69option.
70.PP
71The interactive user prompt is by default the tail of argument zero from
72.IR exec (3),
73usually ``help'', followed by a list of directories leading
74to the current subtopic directory.
75A different prompt may be specified by making a link with a name of your
76choice to /usr/ucb/help or by specifying a name after the
77.B \-p
78option.
79A special prompt is used in help-index mode,
80which is entered when the user initiates an index search
81on a given keyword.
82The string ``-index'' and the keyword are added to the prompt
83in this case.
84.PP
85.I Help
86may be invoked with any number of
87.IR topic ,
88.IR subtopic ,
89.IR subsubtopic ,
90etc., arguments, which may be abbreviated.
91Starting at the top directory level
92.I help
93tries to change to each directory named by successive arguments,
94interactively resolving non-unique abbreviations along the way.
95When a name corresponds to a file, the file is displayed and, unless
96.B \-i
97was specified, the program exits.
98If the standard output is not a terminal,
99.I help
100refuses to be interactive unless the
101.B \-i
102option is given.
103If the last valid name is a directory, or no topics were requested,
104.I help
105lists the topics at the current level and prompts for user input.
106.PP
107Maintainers of
108.IR help -style
109knowledge bases can use the
110.B \-m
111option to perform various custodial functions using shell scripts.
112Permission to use this option is restricted to those users who
113have write permission for one of the directories in the list specified
114after the
115.B \-d
116option or in HELPPOOL.
117If such a directory exists, it (the first one) becomes the value
118of the variable $subtree, and the local maintenance configuration
119is sourced from $subtree/../maint/config before most functions are performed.
120The function name, given as
121.I key
122after
123.B \-m ,
124may be followed by other arguments (but no topic abbreviations
125are recognized here), in which case the script
126$subtree/../maint/do.\fIkey\fP is invoked.
127In the absence of
128.IR key ,
129the word ``default'' is used, usually causing
130the valid function choices to be listed.
131.PP
132A simple macro package called
133.B \-mayday
134is used by authors to format
135.I help
136topic files.
137Its purpose is to standardize somewhat the display format for topic files,
138create a hook for the index generating script, and
139guarantee page headers and footers of a fixed length so that
140.I help
141will not strip out too much or too little of a topic file
142when displaying it without pagination.
143The only macro call required is the initializing macro,
144.BR .TI ,
145followed by a filename and an optional date on the same line,
146and by a keyword-rich title (to be useful for the index) on the next line.
147A handful of other macros are provided for compatibility with other packages,
148though they are usually unnecessary.
149.PP
150Authors of
151.I help
152topics may make topic files into shell scripts by entering a # or :
153at the beginning of the first line.
154This causes help to run the script when that topic is requested,
155allowing programs to be demonstrated, questions asked, etc.
156There are maintenance scripts which will convert a script with embedded
157.I nroff
158source text into a script with embedded formatted text, provided
159the lines to be formatted appear between the special
160lines ``##nroff'' and ``##''.
161.PP
162Similarly, authors may use programs as topic files, the source
163being written in an aribtrary programming language.
164.PP
165The
166.B \-n
167option causes topics to be listed and accessible by numbers
168(and still accessible by unique abbreviations).
169The
170.B \-q
171option suppresses the instruction line appearing before each prompt,
172including the prompt printed by the
173.B \-d
174option to
175.IR more (1),
176through which long output is piped after multiple
177blank lines in a row are reduced to one.
178Both of these features are available as instructions from within
179.IR help .
180.PP
181The internal instructions are described below.
182.PP
183.TP 10
184\fB% \fRor\fB $\fR
185Quit from help and return to the shell.
186Control-d works also.
187.TP 10
188topic
189Display
190.I topic
191on the terminal.
192.I Topic
193may be the shortest unique name
194abbreviating a topic at the current level.
195.I Help
196prompts for more characters if a non-unique name is given,
197and asks to look in the index if the name abbreviates no topic.
198If a name is given as = in any context other than index mode,
199the current topic is used,
200where the current topic is defined to be the one most recently accessed.
201In index mode, a name of = has no special significance, and if
202.I topic
203is a unique abbreviation for a reference, that reference
204is displayed.
205.TP 10
206topic\fB +\fP
207Enter index mode and see what more is known about
208.I topic
209by looking in the indexes.
210A missing topic is taken to be =.
211.TP 10
212topic \fB>\fP file
213Save
214.I topic
215in
216.IR file .
217A missing topic is taken to be =, and a missing
218file is taken to be ``helpsave''.
219If
220.I file
221exists the topic file is appended to it.
222.TP 10
223topic \fB>&\fP file
224Save
225.I topic
226in
227.IR file ,
228preserving headers and footers.
229Normally, topics are stored as
230.IR nroff \'d
231text files, the headers and footers of
232which are suppressed when displayed on a terminal.
233They are preserved in
234.I file
235with this instruction.
236.TP 10
237topic \fB|\fP lpr
238Print
239.I topic
240on the lineprinter, preserving headers and footers.
241The
242.I lpr
243string may be replaced with another program name (such as
244.I ipr
245or
246.IR vpr )
247followed by one optional argument.
248A missing
249.I topic
250is taken to be the current topic, and a missing
251.I lpr
252is taken to be ``lpr''.
253.TP 10
254.B ?
255List the internal instructions and describe them briefly.
256.TP 10
257.B .
258List topics at the current level, indicating the current
259topic, if any, with an =.
260In index mode, list references for the current subject.
261.TP 10
262.B ..
263Back up to and list the next higher level of topics.
264From index mode, this means leave index mode and continue
265at the previous topic level.
266.TP 10
267.B /
268Back up to and list the top level of topics.
269From index mode, this means leave index mode and continue
270at the top level of topics.
271.TP 10
272.B <
273Send comments or other input to the maintainer of
274.I help
275via electronic mail.
276.TP 10
277.BR ! command
278Do a Unix
279.I command
280and then return to help.
281All occurrences of = inside
282.I command
283will be replaced by the current topic, if any.
284.TP 10
285\fB\(**\fP flag \fBon\fP/\fBoff\fP
286Set
287.I flag
288.B on
289or
290.B off
291to adjust the behavior of the program.
292A missing value for
293.I flag
294means invert its current value, and \fB\(**\fP by itself
295means display the current flags, their settings, and
296what they signify.
297There are currently two flags,
298.B n
299and
300.BR q ,
301which control the same things as the
302.B \-n
303and
304.B \-q
305options to
306.IR help .
307.SH FILES
308.nf
309/usr/lib/help/cat root of system \fIhelp\fP files
310/usr/lib/help/src nroff sources for system \fIhelp\fP files
311/usr/lib/help/log log of user requests; can be removed
312/usr/lib/help/maint maintenance scripts
313/usr/lib/help/cat/general general introduction to \fIhelp\fP
314/usr/lib/help/cat/index_\(** used to locate further references
315/usr/lib/tmac/tmac.ayday macro package for \fIhelp\fP files
316.fi
317.SH SEE\ ALSO
318environ(7), exec(3), learn(1), lpr(1), more(1), nroff(1)
319.SH AUTHOR
320John Kunze
321.SH BUGS
322Pathnames inside topic names are not recognized.
323
324.I Help
325is really just a weak, friendly shell.
326Strengthening it might be more painful and less useful
327than civilizing the shell.