command line options

Walter Bays walter at garth.UUCP
Tue Mar 29 07:48:49 AEST 1988


In article <2414 at zyx.UUCP> aj at zyx.SE (Arndt Jonasson) writes:
>This is a suggestion for a command line parsing routine for C programs
>in Unix. [...]
>Recently, I invented a parsing routine of my own that doesn't require
>the program logic to be supplied by the application programmer. [...]
>If it seems to be generally useful, I will post the code to comp.unix.sources.
>An example program that exhibits nearly all the features [followed]

Sounds great to me.  Thanks, I'd love to have a copy.  A higher level
routine than getopt() would induce lazy programmers like me to do it
right.  (It's only for my own use, getopt is too much trouble, and I'll
never forget the argument order, right? :-)

Some will say it should work like getopt():  "-AB" equals "-A -B".
Others will argue for multiple character options:  "-132 -postscript".
SysV doesn't follow the SysV standard yet.  I would like some standard,
so I'm for following the Posix standard (whatever that is)?

Please resist suggestions to add semantic checking routines (i.e. range of
numbers, existence of files) which belong in the application program.
I'd rather code such things directly rather than pass pointers to functions.
-- 
------------------------------------------------------------------------------
Any similarities between my opinions and those of the
person who signs my paychecks is purely coincidental.
E-Mail route: ...!pyramid!garth!walter
USPS: Intergraph APD, 2400 Geng Road, Palo Alto, California 94303
Phone: (415) 852-2384
------------------------------------------------------------------------------



More information about the Comp.lang.c mailing list