Subject: Re: using getopt_long (was Re: Bluetooth update)
To: Hubert Feyrer <feyrer@cs.stevens.edu>
From: Roland Illig <rillig@NetBSD.org>
List: tech-userlevel
Date: 12/18/2005 11:55:17
Hubert Feyrer wrote:
> On Sun, 18 Dec 2005, der Mouse wrote:
> 
>> What I don't get is what's wrong with "-requires" and "-required-by".
>> But maybe *I*'m just old and slow.
> 
> 
> I guess that would be equivalent to -r -e -q (etc.), which programs 
> should treat like -q -e -r and like -qer and any variants.

while ((opt = getopt(argc, argv, "r:")) != -1) {
	switch (opt) {
		case 'r':
			if (strcmp(optarg, "equires") == 0) {
				...

			} else if (strcmp(optarg, "equired-by") == 0) {
				...

			} else {
				usage();
			}
			break;

		...
	}
}

This looks funny. :)

Roland