Path: utzoo!attcan!uunet!lll-winken!ames!haven!adm!cmcl2!phri!roy From: roy@phri.UUCP (Roy Smith) Newsgroups: comp.lang.c Subject: Using getopt to parse multi-argument options Message-ID: <3652@phri.UUCP> Date: 15 Jan 89 01:47:34 GMT Organization: Public Health Research Institute, NYC, NY Lines: 13 [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@uunet.uu.net "The connector is the network"