summaryrefslogtreecommitdiff
path: root/builtins/getopts.def
diff options
context:
space:
mode:
Diffstat (limited to 'builtins/getopts.def')
-rw-r--r--builtins/getopts.def30
1 files changed, 18 insertions, 12 deletions
diff --git a/builtins/getopts.def b/builtins/getopts.def
index a9aad62..c077c8e 100644
--- a/builtins/getopts.def
+++ b/builtins/getopts.def
@@ -5,26 +5,28 @@ Copyright (C) 1987-2004 Free Software Foundation, Inc.
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 2, or (at your option) any later
-version.
+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 3 of the License, or
+(at your option) any later version.
-Bash is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
+Bash is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
+You should have received a copy of the GNU General Public License
+along with Bash. If not, see <http://www.gnu.org/licenses/>.
$PRODUCES getopts.c
$BUILTIN getopts
$FUNCTION getopts_builtin
$SHORT_DOC getopts optstring name [arg]
-Getopts is used by shell procedures to parse positional parameters.
+Parse option arguments.
+
+Getopts is used by shell procedures to parse positional parameters
+as options.
OPTSTRING contains the option letters to be recognized; if a letter
is followed by a colon, the option is expected to have an argument,
@@ -54,6 +56,10 @@ OPTSTRING is not a colon. OPTERR has the value 1 by default.
Getopts normally parses the positional parameters ($0 - $9), but if
more arguments are given, they are parsed instead.
+
+Exit Status:
+Returns success if an option is found; fails if the end of options is
+encountered or an error occurs.
$END
#include <config.h>