Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
Makefile | H A D | 26-Nov-2011 | 199 | 7 | 2 | |
README | H A D | 26-Nov-2011 | 2.2 KiB | 58 | 44 | |
getopt.1 | H A D | 01-Jan-2016 | 3.4 KiB | 148 | 147 | |
getopt.c | H A D | 26-Nov-2011 | 716 | 33 | 27 |
README
1/***** unido:mod.std.unix / ut-sally!jsq / 8:54 pm Jul 4, 1985*/ 2From: John Quarterman (moderator) <ut-sally!std-unix> 3 4Topic: yet more on getopt (command line arguments) 5 6Two more messages, the first a followup to a previous posting, and 7the second public domain sources and man pages for getopt(3) and getopt(1). 8 -mod 9 10---------------------------------------------------------------------- 11 12From: ihnp4!utzoo!henry 13Date: 3 Jul 85 18:34:41 CDT (Wed) 14To: ihnp4!ut-sally!std-unix 15Subject: Re: command line arguments 16 17> > A group of bundled options may end with an option that has an argument. 18> 19> This creates confusion in using C-Kermit when you want to send an image 20> file. For example: 21> 22> send -is filename < --- works fine 23> send -si filename < --- bombs the program 24 25The AT&T syntax standard (which getopt does not completely enforce) 26actually forbids both of these usages. Options with arguments are not 27allowed to be bundled, and they must be separated from their arguments 28by a space. 29 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 32> listed. 33 34The 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 36the AT&T people did the right thing. 37 38------------------------------ 39 40Date: Tue, 2 Jul 85 13:07:09 edt 41From: ihnp4!utcs!ian (Ian F. Darwin) 42To: ihnp4!ut-sally!jsq@tzec.UTEXAS.ARPA 43Subject: here is getopt 44 45Here is the source for getopt(3), the function that should be in 46everybody's C program, and getopt(1), a program that uses it to 47make shell programs comprehensible and consistent. There are man 48pages for both. Please send these on to the mod. group. Thanks. 49 50[ I have hacked the following shell script slightly so that 51it doesn't extract directly into system source directories, 52rather into the current directory. It should be assumed that 53this code comes with no warranty from me, Ian Darwin, or anyone 54else as to whether it accurately represents getopt as distributed 55with System V, or any command line standard, or that it works 56at all, or that it will cause no damage when extracted or used. -mod] 57 58