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