source: trunk/essentials/app-shells/bash/builtins/help.def@ 3232

Last change on this file since 3232 was 3228, checked in by bird, 19 years ago

bash 3.1

File size: 4.9 KB
Line 
1This file is help.def, from which is created help.c.
2It implements the builtin "help" in Bash.
3
4Copyright (C) 1987-2003 Free Software Foundation, Inc.
5
6This file is part of GNU Bash, the Bourne Again SHell.
7
8Bash is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
10Software Foundation; either version 2, or (at your option) any later
11version.
12
13Bash is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
17
18You should have received a copy of the GNU General Public License along
19with Bash; see the file COPYING. If not, write to the Free Software
20Foundation, 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 ...]
28Display helpful information about builtin commands. If PATTERN is
29specified, gives detailed help on all commands matching PATTERN,
30otherwise a list of the builtins is printed. The -s option
31restricts the output for each builtin command matching PATTERN to
32a 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
63extern int errno;
64#endif
65
66static void show_builtin_command_help __P((void));
67static void show_longdoc __P((int));
68
69/* Print out a list of the known functions in the shell, and what they do.