Autah-cs.163 net.unix-wizards utcsrgv!utzoo!decvax!ucbvax!ihnss!cbosg!harpo!utah-cs!lepreau Sat Jan 16 12:12:48 1982 getopt(3) & scanargs(3): arg line scanners Apologies to those in Arpa land who see this twice. Sometime ago I sent this to unix-wizards via the Arpanet, and it never showed up on Usenet. I don't think that any other Arpa stuff has been gatewayed to Usenet either for a while. (The other direction is working, but apparently subject to up to a week's delay.) So here it is again: ---------- We've been using something which sounds similar to "getopt" called "scanargs," originally from Ampex on an old conference tape and enhanced by us. It's public domain, and we'll send it and its man page to anyone. [Perhaps we can put it at some central sites to facilitate Usenet access.] It certainly makes it trivial to add/change flags (try adding flags to 'who' someday if you want a thrill!)... It handles optional and required arguments, be they flags, strings, floating and integer numbers, or some combinations of those. It's flexible about argument format & order and can distinguish floating from integer from string args, for example. If the args don't match up it generates a standard "Usage" message that provides a degree of user help. [The usage message is built into the format control, so they are more likely to remain in sync.] And it's quite easy to use. Motherhood & apple pie. Now to get hold of a getopt manual page... ---------- jay lepreau decvax!{harpo,randvax}!utah-cs!lepreau, lepreau@utah-20 ----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen of http://communication.ucsd.edu/A-News/ This Usenet Oldnews Archive article may be copied and distributed freely, provided: 1. There is no money collected for the text(s) of the articles. 2. The following notice remains appended to each copy: The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.