Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site burl.UUCP Path: utzoo!watmath!clyde!burl!rcj From: rcj@burl.UUCP (Curtis Jackson) Newsgroups: net.sources.bugs Subject: Re: getopt(3) posting FLAME Message-ID: <898@burl.UUCP> Date: Thu, 17-Oct-85 16:59:10 EDT Article-I.D.: burl.898 Posted: Thu Oct 17 16:59:10 1985 Date-Received: Fri, 18-Oct-85 01:33:23 EDT References: <910@utcs.uucp> <306@graffiti.UUCP> Reply-To: rcj@burl.UUCP (Curtis Jackson) Organization: AT&T Technologies, Burlington NC Lines: 32 Keywords: Huh?! Summary: In article <306@graffiti.UUCP> peter@graffiti.UUCP (Peter da Silva) writes: >[getopt] does the wrong thing. It can't even handle the arguments that >sort(1) (V7) uses, to wit: > > sort -mubdfincrtx > >Where the final 'tx' means 'tab character '. The rest of sort's arguments >are even less parsable by getopt. There is no reason for getopt's >insistence on lots of whitespace, nor for its ignoring argument order, nor >for its inability to handle '+' and '-' type command flags... All this is based in getopt from AT&T Unix Sys III and up: Agreed that getopt cannot handle '+' type command flags, BUT -- it can indeed handle the trailing tx mentioned above, it ignores whitespace between switches that do not require arguments, and it does NOT ignore argument order. Sounds to me like you have an inferior, 'non-standard' getopt. >do the same thing, allows more flexibility (foo -s -g:; foo -s -g :; foo -sg:; >foo -sg :), and produces a program that needs less core. If you think that's >a minor consideration, remember why vi doesn't use stdio on a PDP-11. Again, 'real' getopt will accept all of the above combinations of -s and -g above. Agreed, it does add somewhat to the size of your program -- but since I write microassemblers and compilers that generally have 15-20 command-line switches I don't really mind -- it buys me a lot of clarity. Also, I am on a Vax 11/780 with 10 meg main memory :-) -- The MAD Programmer -- 919-228-3313 (Cornet 291) alias: Curtis Jackson ...![ ihnp4 ulysses cbosgd mgnetp ]!burl!rcj ...![ ihnp4 cbosgd akgua masscomp ]!clyde!rcj