• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

gnu/H03-May-2022-1,375805

po/H24-Nov-2014-5,4374,519

tests/H07-May-2022-15381

COPYINGH A D19-Nov-201417.6 KiB340281

ChangelogH A D24-Nov-20142.9 KiB5655

MakefileH A D03-May-20222.6 KiB10983

Makefile.util-linuxH A D19-Nov-20141.2 KiB5535

READMEH A D20-Nov-20142.9 KiB8256

TODOH A D24-Nov-2014170 53

getopt-parse.bashH A D19-Nov-20141.5 KiB4819

getopt-parse.tcshH A D19-Nov-20142.2 KiB7837

getopt-test.bashH A D19-Nov-2014122 75

getopt-test.tcshH A D19-Nov-2014120 86

getopt.1H A D20-Nov-201413.8 KiB464463

getopt.cH A D24-Nov-201413.3 KiB473324

messages.poH A D21-Nov-20143.5 KiB177143

nls.hH A D20-Nov-20141.6 KiB5220

run-testsH A D23-Nov-20141.7 KiB7259

util-linux-compat.hH A D20-Nov-2014711 2311

xalloc.hH A D19-Nov-2014926 4124

README

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 (upto version
72.7.1). But, there are some problems with that getopt(1) implementation,
8as listed in the '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-2014 by Frodo Looijaard
73<frodo@frodo.looijaard.name>.
74Files in the gnu directory are from glibc-2.0.4: copyright (C) 1987, 88,
7589, 90, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
76
77
78DOWNLOADING
79
80You can find the latest version of this program at:
81  http://software.frodo.looijaard.name/getopt/
82