1 /***** unido:mod.std.unix / ut-sally!jsq / 8:54 pm Jul 4, 1985*/
2 From: John Quarterman (moderator) <ut-sally!std-unix>
4 Topic: yet more on getopt (command line arguments)
6 Two more messages, the first a followup to a previous posting, and
7 the second public domain sources and man pages for getopt(3) and getopt(1).
10 ----------------------------------------------------------------------
12 From: ihnp4!utzoo!henry
13 Date: 3 Jul 85 18:34:41 CDT (Wed)
14 To: ihnp4!ut-sally!std-unix
15 Subject: Re: command line arguments
17 > > A group of bundled options may end with an option that has an argument.
19 > This creates confusion in using C-Kermit when you want to send an image
22 > send -is filename < --- works fine
23 > send -si filename < --- bombs the program
25 The AT&T syntax standard (which getopt does not completely enforce)
26 actually forbids both of these usages. Options with arguments are not
27 allowed to be bundled, and they must be separated from their arguments
30 > I would *much* prefer to bundle the flags, then
31 > have those with arguments pick them up in the same order as the flags are
34 The few existing commands that use such a convention, notably tar(1), are
35 (in my experience) the worse for it. It's seriously error-prone. I think
36 the AT&T people did the right thing.
38 ------------------------------
40 Date: Tue, 2 Jul 85 13:07:09 edt
41 From: ihnp4!utcs!ian (Ian F. Darwin)
42 To: ihnp4!ut-sally!jsq@tzec.UTEXAS.ARPA
43 Subject: here is getopt
45 Here is the source for getopt(3), the function that should be in
46 everybody's C program, and getopt(1), a program that uses it to
47 make shell programs comprehensible and consistent. There are man
48 pages for both. Please send these on to the mod. group. Thanks.
50 [ I have hacked the following shell script slightly so that
51 it doesn't extract directly into system source directories,
52 rather into the current directory. It should be assumed that
53 this code comes with no warranty from me, Ian Darwin, or anyone
54 else as to whether it accurately represents getopt as distributed
55 with System V, or any command line standard, or that it works
56 at all, or that it will cause no damage when extracted or used. -mod]