| 1 | This file is help.def, from which is created help.c.
|
|---|
| 2 | It implements the builtin "help" in Bash.
|
|---|
| 3 |
|
|---|
| 4 | Copyright (C) 1987-2003 Free Software Foundation, Inc.
|
|---|
| 5 |
|
|---|
| 6 | This file is part of GNU Bash, the Bourne Again SHell.
|
|---|
| 7 |
|
|---|
| 8 | Bash is free software; you can redistribute it and/or modify it under
|
|---|
| 9 | the terms of the GNU General Public License as published by the Free
|
|---|
| 10 | Software Foundation; either version 2, or (at your option) any later
|
|---|
| 11 | version.
|
|---|
| 12 |
|
|---|
| 13 | Bash is distributed in the hope that it will be useful, but WITHOUT ANY
|
|---|
| 14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|---|
| 15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|---|
| 16 | for more details.
|
|---|
| 17 |
|
|---|
| 18 | You should have received a copy of the GNU General Public License along
|
|---|
| 19 | with Bash; see the file COPYING. If not, write to the Free Software
|
|---|
| 20 | Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
|---|
| 21 |
|
|---|
| 22 | $PRODUCES help.c
|
|---|
| 23 |
|
|---|
| 24 | $BUILTIN help
|
|---|
| 25 | $FUNCTION help_builtin
|
|---|
| 26 | $DEPENDS_ON HELP_BUILTIN
|
|---|
| 27 | $SHORT_DOC help [-s] [pattern ...]
|
|---|
| 28 | Display helpful information about builtin commands. If PATTERN is
|
|---|
| 29 | specified, gives detailed help on all commands matching PATTERN,
|
|---|
| 30 | otherwise a list of the builtins is printed. The -s option
|
|---|
| 31 | restricts the output for each builtin command matching PATTERN to
|
|---|
| 32 | a short usage synopsis.
|
|---|
| 33 | $END
|
|---|
| 34 |
|
|---|
| 35 | #include <config.h>
|
|---|
| 36 |
|
|---|
| 37 | #if defined (HELP_BUILTIN)
|
|---|
| 38 | #include <stdio.h>
|
|---|
| 39 |
|
|---|
| 40 | #if defined (HAVE_UNISTD_H)
|
|---|
| 41 | # ifdef _MINIX
|
|---|
| 42 | # include <sys/types.h>
|
|---|
| 43 | # endif
|
|---|
| 44 | # include <unistd.h>
|
|---|
| 45 | #endif
|
|---|
| 46 |
|
|---|
| 47 | #include <errno.h>
|
|---|
| 48 |
|
|---|
| 49 | #include <filecntl.h>
|
|---|
| 50 |
|
|---|
| 51 | #include "../bashintl.h"
|
|---|
| 52 |
|
|---|
| 53 | #include "../shell.h"
|
|---|
| 54 | #include "../builtins.h"
|
|---|
| 55 | #include "../pathexp.h"
|
|---|
| 56 | #include "common.h"
|
|---|
| 57 | #include "bashgetopt.h"
|
|---|
| 58 |
|
|---|
| 59 | #include <glob/strmatch.h>
|
|---|
| 60 | #include <glob/glob.h>
|
|---|
| 61 |
|
|---|
| 62 | #ifndef errno
|
|---|
| 63 | extern int errno;
|
|---|
| 64 | #endif
|
|---|
| 65 |
|
|---|
| 66 | static void show_builtin_command_help __P((void));
|
|---|
| 67 | static void show_longdoc __P((int));
|
|---|
| 68 |
|
|---|
| 69 | /* Print out a list of the known functions in the shell, and what they do.
|
|---|
|
|---|