xref: /csrg-svn/usr.bin/more/help.c (revision 35209)
1*35209Sbostic /*
2*35209Sbostic  * Copyright (c) 1988 Mark Nudleman
3*35209Sbostic  * Copyright (c) 1988 Regents of the University of California.
4*35209Sbostic  * All rights reserved.
5*35209Sbostic  *
6*35209Sbostic  * This code is derived from software contributed to Berkeley by
7*35209Sbostic  * Mark Nudleman.
8*35209Sbostic  *
9*35209Sbostic  * Redistribution and use in source and binary forms are permitted
10*35209Sbostic  * provided that the above copyright notice and this paragraph are
11*35209Sbostic  * duplicated in all such forms and that any documentation,
12*35209Sbostic  * advertising materials, and other materials related to such
13*35209Sbostic  * distribution and use acknowledge that the software was developed
14*35209Sbostic  * by the University of California, Berkeley.  The name of the
15*35209Sbostic  * University may not be used to endorse or promote products derived
16*35209Sbostic  * from this software without specific prior written permission.
17*35209Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
18*35209Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
19*35209Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20*35209Sbostic  */
21*35209Sbostic 
22*35209Sbostic #ifndef lint
23*35209Sbostic static char sccsid[] = "@(#)help.c	5.1 (Berkeley) 07/21/88";
24*35209Sbostic #endif /* not lint */
25*35209Sbostic 
26*35209Sbostic #include  "less.h"
27*35209Sbostic 
28*35209Sbostic /*
29*35209Sbostic  * Display some help.
30*35209Sbostic  * Just invoke another "less" to display the help file.
31*35209Sbostic  *
32*35209Sbostic  * {{ This makes this function very simple, and makes changing the
33*35209Sbostic  *    help file very easy, but it may present difficulties on
34*35209Sbostic  *    (non-Unix) systems which do not supply the "system()" function. }}
35*35209Sbostic  */
36*35209Sbostic 
37*35209Sbostic 	public void
38*35209Sbostic help()
39*35209Sbostic {
40*35209Sbostic 	char cmd[FILENAME+100];
41*35209Sbostic 
42*35209Sbostic 	sprintf(cmd,
43*35209Sbostic 	 "-less -m '-PmHELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done ' %s",
44*35209Sbostic 	 HELPFILE);
45*35209Sbostic 	lsystem(cmd);
46*35209Sbostic 	error("End of help");
47*35209Sbostic }
48