diff options
author | wiz <wiz> | 2004-12-26 15:55:39 +0000 |
---|---|---|
committer | wiz <wiz> | 2004-12-26 15:55:39 +0000 |
commit | b7f358f2b0dfc2a32af262c7f0a02dd1e61bb442 (patch) | |
tree | d518130338b9233742d760f54477ed7e0a7b1324 /misc/getopt/DESCR | |
parent | 0b67ded3b838bd406f957ee97cd3c0b6ab292574 (diff) | |
download | pkgsrc-b7f358f2b0dfc2a32af262c7f0a02dd1e61bb442.tar.gz |
Initial import of getopt, a getopt(1) replacement supporting long options.
Getopt(1) is a program to help shell scripts parse command-line
parameters. It is for example included in the util-linux distribution
(versions up to 2.7.1) for Linux. But, there were some problems
with that getopt(1) implementation, as listed in the 'BUGS' section
of its man-page:
* Whatever getopt(3) has.
* Arguments containing white space or imbedded shell metacharacters
generally will not survive intact; this looks easy to fix but
isn't.
* The error message for an invalid option is identified as
coming from getopt rather than from the shell procedure
containing the invocation of getopt; this again is hard to
fix.
* The precise best way to use the set command to set the
arguments without disrupting the value(s) of shell options
varies from one shell version to another.
Additionally, the example in the manual-page does not run correctly
(at least not with any bash shell I have tried).
This implementation of getopt(1) solves some of these problems,
while still staying (for all practical purposes) completely compatible
with other getopt(1) implementations. It has replaced the old
util-linux version, but it should be useful for other Unixes too.
Diffstat (limited to 'misc/getopt/DESCR')
-rw-r--r-- | misc/getopt/DESCR | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/misc/getopt/DESCR b/misc/getopt/DESCR new file mode 100644 index 00000000000..2d27314455c --- /dev/null +++ b/misc/getopt/DESCR @@ -0,0 +1,23 @@ +Getopt(1) is a program to help shell scripts parse command-line +parameters. It is for example included in the util-linux distribution +(versions up to 2.7.1) for Linux. But, there were some problems +with that getopt(1) implementation, as listed in the 'BUGS' section +of its man-page: + * Whatever getopt(3) has. + * Arguments containing white space or imbedded shell metacharacters + generally will not survive intact; this looks easy to fix but + isn't. + * The error message for an invalid option is identified as + coming from getopt rather than from the shell procedure + containing the invocation of getopt; this again is hard to + fix. + * The precise best way to use the set command to set the + arguments without disrupting the value(s) of shell options + varies from one shell version to another. +Additionally, the example in the manual-page does not run correctly +(at least not with any bash shell I have tried). + +This implementation of getopt(1) solves some of these problems, +while still staying (for all practical purposes) completely compatible +with other getopt(1) implementations. It has replaced the old +util-linux version, but it should be useful for other Unixes too. |