diff options
author | Jari Aalto <jari.aalto@cante.net> | 2000-03-17 21:46:59 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:53 +0000 |
commit | bb70624e964126b7ac4ff085ba163a9c35ffa18f (patch) | |
tree | ba2dd4add13ada94b1899c6d4aca80195b80b74b /builtins/help.def | |
parent | b72432fdcc59300c6fe7c9d6c8a31ad3447933f5 (diff) | |
download | android_external_bash-bb70624e964126b7ac4ff085ba163a9c35ffa18f.tar.gz android_external_bash-bb70624e964126b7ac4ff085ba163a9c35ffa18f.tar.bz2 android_external_bash-bb70624e964126b7ac4ff085ba163a9c35ffa18f.zip |
Imported from ../bash-2.04.tar.gz.
Diffstat (limited to 'builtins/help.def')
-rw-r--r-- | builtins/help.def | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/builtins/help.def b/builtins/help.def index cd59d3c..4382229 100644 --- a/builtins/help.def +++ b/builtins/help.def @@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell. Bash is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 1, or (at your option) any later +Software Foundation; either version 2, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY @@ -17,17 +17,19 @@ for more details. You should have received a copy of the GNU General Public License along with Bash; see the file COPYING. If not, write to the Free Software -Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. $PRODUCES help.c $BUILTIN help $FUNCTION help_builtin $DEPENDS_ON HELP_BUILTIN -$SHORT_DOC help [pattern ...] +$SHORT_DOC help [-s] [pattern ...] Display helpful information about builtin commands. If PATTERN is specified, gives detailed help on all commands matching PATTERN, -otherwise a list of the builtins is printed. +otherwise a list of the builtins is printed. The -s option +restricts the output for each builtin command matching PATTERN to +a short usage synopsis. $END #include <config.h> @@ -64,14 +66,17 @@ help_builtin (list) { register int i, j; char *pattern, *name; - int plen, match_found; + int plen, match_found, sflag; - /* Placeholder for future options. */ + sflag = 0; reset_internal_getopt (); - while ((i = internal_getopt (list, "")) != -1) + while ((i = internal_getopt (list, "s")) != -1) { switch (i) { + case 's': + sflag = 1; + break; default: builtin_usage (); return (EX_USAGE); @@ -108,8 +113,9 @@ help_builtin (list) { printf ("%s: %s\n", name, shell_builtins[i].short_doc); - for (j = 0; shell_builtins[i].long_doc[j]; j++) - printf (" %s\n", shell_builtins[i].long_doc[j]); + if (sflag == 0) + for (j = 0; shell_builtins[i].long_doc[j]; j++) + printf (" %s\n", shell_builtins[i].long_doc[j]); match_found++; } |