Xref: utzoo comp.lang.c:8748 comp.unix.wizards:7486 Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!pacbell!trane!gold From: gold@trane.UUCP (Michael Gold) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: command line options Message-ID: <363@trane.UUCP> Date: 1 Apr 88 01:20:04 GMT References: <2517@geac.UUCP> Organization: Aurora Systems San Francisco, California Lines: 28 From article <2517@geac.UUCP>, by daveb@geac.UUCP (David Collier-Brown): > I did a parser with static control tables, and admit I like the > scanf-style ones better. Feel free to post... I agree that the 'scanf' paradigm is neater, assuming a fairly small set of options. For programs with more complex command lines, where the format string would overflow a line of source code and be otherwise unwieldy, I prefer the static data structure. The ideal solution would be a package that accepts either interface at the user's preference. I cite the various flavors of 'exec*(2)' as precedent. Or does that raise red flags on account of unnecessary multiplicity?? Anyway, I'd propose three more requirements for this package: 1) Capability of handling multi-character flags, 2) Acceptance of arguments to flags that may or may not be appended to the flag, as in the -I and -o flags of most 'cc's respectively, and 3) Positional independence of the tokens, except for arguments bound to particular flags. I sense from the volume and quality of this discussion that improving getopt() is both desirable and non-trivial. Let's keep at it. -------- Michael Gold / (415) 780-4903 / {ihnp4,ames,sun,pyramid,...}!pacbell!trane!gold