]> git.ipfire.org Git - thirdparty/util-linux.git/blame - getopt/README
Imported from util-linux-2.8 tarball.
[thirdparty/util-linux.git] / getopt / README
CommitLineData
2b6fc908
KZ
1This package contains a reimplementation of getopt(1).
2
3PREFACE
4
5Getopt(1) is a program to help shell scripts parse command-line parameters.
6It is for example included in the util-linux distribution. But, there are
7some problems with that getopt(1) implementation, as listed in the
8'BUGS' section of its man-page:
9
10>BUGS
11> Whatever getopt(3) has.
12>
13> Arguments containing white space or imbedded shell metacharacters gener-
14> ally will not survive intact; this looks easy to fix but isn't.
15>
16> The error message for an invalid option is identified as coming from
17> getopt rather than from the shell procedure containing the invocation of
18> getopt; this again is hard to fix.
19>
20> The precise best way to use the set command to set the arguments without
21> disrupting the value(s) of shell options varies from one shell version to
22> another.
23
24This implementation of getopt(1) is written to solve some of these problems,
25while still staying (for all practical purposes) completely compatible with
26other getopt(1) implementations.
27
28
29INSTALLATION
30
31Installation should be very easy. Just type 'make' to compile the sources.
32It should compile cleanly, without any warnings, but even if it does not
33you probably don't have to worry. You must use GNU Make and gcc, or you
34will have to edit the Makefile.
35
36Type 'make install' to install the binary and the manual page. It installs
37by default in /usr/local/bin and /usr/local/man/man1, to install in /usr/bin
38and /usr/man/man1 try 'make install prefix=/usr'.
39
40The example files can be installed in /usr/local/lib/getopt by calling
41'make install_doc'.
42
43If you do not trust the getopt(3) in your libc, or if you do not use a libc
44with the GNU getopt(3) routines, you can use the gnu sources as provided
45in the gnu directory. Try 'make LIBCGETOPT=0'. Ignore any compile warnings.
46
47You can check whether the new implementation of getopt is found first
48in your path by calling 'bash test.bash'.
49
50
51HIGHLIGHTS
52
53It can do anything that the GNU getopt(3) routines can do.
54
55It can cope with spaces and shell metacharacters within arguments.
56
57It can parse long parameters.
58
59It can shuffle parameters, so you can mix options and other parameters on
60the command-line.
61
62It can be easily identified as an enhanced getopt(1) from within shell scripts.
63
64It can report parse errors as coming from the shell script.
65
66It is fully compatible with other getopt(1) implementations.
67
68COPYING
69
70This program comes under the GNU general public licence version 2. See the
71file COPYING included in this package. Note that though you may freely
72copy it, it is copyright (c) 1997 by Frodo Looijaard <frodol@dds.nl>.
73Files in the gnu directory are from glibc-2.0.4: copyright (C) 1987, 88,
7489, 90, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
75
76
77DOWNLOADING
78
79You can find the latest version of this program at
80<http://huizen.dds.nl/~frodol>.