Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: ARGV parsing -- The Recommended way
Message-ID: <1989Jul14.154931.1955@utzoo.uucp>
Organization: U of Toronto Zoology
References: <7292@bunny.GTE.COM>
Date: Fri, 14 Jul 89 15:49:31 GMT

In article <7292@bunny.GTE.COM> hhg1@GTE.COM (Hallett German) writes:
>    And use other functions like getopt.

Using getopt is the right way to do it, unless there are *compelling*
reasons to do otherwise (notably, backward compatibility with a program
that uses non-standard syntax).  It is an enormous win to have standard,
predictable syntax for options.  Getopt, for all its warts, accomplishes
that, without breaking the whole world (which is what attempts at syntax
reform end up doing, which is why they always fail).

The one wart of getopt is that it's a bit awkward to use "cold".  The
most effective way is to type in the example from the getopt manual page
*once* and use that as a template, modifying a copy of it rather than
trying to type it in from scratch each time.
-- 
$10 million equals 18 PM       |     Henry Spencer at U of Toronto Zoology
(Pentagon-Minutes). -Tom Neff  | uunet!attcan!utzoo!henry henry@zoo.toronto.edu
