Using getopt to parse multi-argument options
Roy Smith
roy at phri.UUCP
Sun Jan 15 11:47:34 AEST 1989
[not strictly a C question, but comp.lang.c seems to be the best place]
I'm writing a program which will take an optional range, in the
style of graph(1)'s "-x xmin xmax". How do I tell getopt to parse
something like that? I suppose I could diddle with optind to make getopt
skip the next argument, but that hardly seems kosher. The obvious way to
do this would be to have getopt support a syntax like "-r::" which means
the "-r" flag has *two* arguments after it but it's too late now.
--
Roy Smith, System Administrator
Public Health Research Institute
{allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy at uunet.uu.net
"The connector is the network"
More information about the Comp.lang.c
mailing list