Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!itivax!scs From: scs@itivax.iti.org (Steve Simmons) Newsgroups: comp.lang.perl Subject: Re: getopt Message-ID: <4648@itivax.iti.org> Date: 13 Dec 89 14:29:12 GMT References: <6584@jpl-devvax.JPL.NASA.GOV> <4644@itivax.iti.org> <6587@jpl-devvax.JPL.NASA.GOV> Organization: Industrial Technology Institute, Ann Arbor, MI. Lines: 42 lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: >In article <4644@itivax.iti.org> scs@itivax.iti.org (Steve Simmons) writes: >: There do exist a number of switches which take optional trailing >: arguements . . . >Way back when AT&T was suggesting a standard for switch parsing, > cc -O3 >would mean the same as two separate switches: > cc -O -3 >They were requiring space between a switch and any option so that they could >do switch bundling. Someplace here I've got the brochure they were handing >out at Usenix at the time. "-O3" == "-O -3" if and only if (1) O is a defined switch which does not take a trailing arg, and (2) 3 is a defined switch. Otherwise the first means "-O with value 3" while the second means "-O with value -3". Switch grouping was allowed as you describe, but any switch with a trailer consumed the next arg. 'Next arg' in this case had the very curious definition of being (my paraphrase) 'if there are unprocessed characters following the switch they will be used as the trailer, otherwise the next argument in the list is the trailer'. So if we assume -O takes no trailer but -G does cc -O3G4 means "-O switch", "-3 switch (illegal, since we haven't defined such)", "-G switch with optarg 4". Of course, without my brochure handy I can't quote chapter and verse, but that's was my interpretation of it based on reading the brochure and their getopt() source some years ago. Whatever happened to that "standard", anyway? I believe the brochure claimed it would be part of SVID utilities or something like that. -- Steve Simmons scs@iti.org Industrial Technology Institute '"You're not a big name on Usenet until someone puts you in their .sig file." -- Anonymous'