Path: utzoo!attcan!uunet!longway!std-unix From: darcy@druid.uucp (D'Arcy J.M. Cain) Newsgroups: comp.std.unix Subject: Re: parseargs vs. getopt Message-ID: <733@longway.TIC.COM> Date: 23 Jun 90 19:27:43 GMT References: <378@usenix.ORG> <728@longway.TIC.COM> <729@longway.TIC.COM> Sender: std-unix@longway.TIC.COM Reply-To: darcy@druid.uucp (D'Arcy J.M. Cain) Organization: D'Arcy Cain Consulting, West Hill, Ontario Lines: 27 Approved: jsq@longway.tic.com (Moderator, John S. Quarterman) From: darcy@druid.uucp (D'Arcy J.M. Cain) In article <729@longway.TIC.COM> From: David J. MacKenzie >Parseargs has a lot of problems; I looked at it and discarded it. It >might provide a superior interface to the programmer, but it doesn't >provide the same interface to the user; that is, it doesn't conform to >the standard Unix option syntax that most programs use (allowing >ganging of multiple single-letter options into a single argument, for >example). Since getopt is an existing-practice de-facto standard, I You might like my getarg function. I designed it as a replacement for getopt but in such a way that the user can use it exactly like getopt. It does however support extra functionality which can be used if the user is aware of it. For one thing, options and arguments (files) can be mixed instead of requiring all options to precede the files. You can also initialise the argument list more than once supporting things such as environment default command lines, arguments from files etc mixed with arguments from the command line. I just posted it recently to alt.sources and I'm interested in getting some feedback on it. -- D'Arcy J.M. Cain (darcy@druid) | Government: D'Arcy Cain Consulting | Organized crime with an attitude West Hill, Ontario, Canada | (416) 281-6094 | Volume-Number: Volume 20, Number 45