Path: utzoo!utgpu!water!watmath!clyde!rutgers!ucla-cs!zen!ucbvax!bostic
From: bostic@ucbvax.BERKELEY.EDU (Keith Bostic)
Newsgroups: comp.unix.wizards
Subject: Re: Command interfaces
Message-ID: <22204@ucbvax.BERKELEY.EDU>
Date: 17 Dec 87 03:11:10 GMT
References: <432@cresswell.quintus.UUCP> <57900005@ccvaxa> <489@hscfvax.harvard.edu>
Organization: University of California at Berkeley
Lines: 31

In article <489@hscfvax.harvard.edu>, mohamed@hscfvax.harvard.edu (Mohamed_el_Lozy) writes:
> It can (and perhaps should) be made even easier.  A year or so ago I
> posted a program to the non-moderated sources group called mkprog that
> would take (too many) arguments and produce the getopt(3) switch,
> together with declaring the flags as suitable variables and many other
> things.

	I've seen several of these programs, and I usually have two problems
with them -- they invariably do too much, and they invariably do too little,
i.e. they invariably handle things that I've never needed, and invariably
don't handle things I want.
	For example, with the option "-f filename", I often immediately
open the file, for obvious reasons.  I've yet to see a program that will
handle that.  And global variables!  How many programs (that aren't using
one of these parsers) really need to have their option variables be
global?  How about options that update the same variable, but have a
relationship, i.e. both set a variable unless it's already set in which
case it's an error?  Sure, I know that I can use one of these programs
if I parse arguments the way *it* wants to parse them, but the idea of
tools is to make my life easier -- not to help me reduce my social life
to a fond memory.

> Complex interfaces can, and should, be made simpler by putting a
> suitable wrapper around them.

I agree -- but I have yet to see an example where the wrapper is less
complex than the wrappee.  Send me one and I'll switch in a heartbeat.

Keith Bostic
ARPA:	bostic@okeeffe.berkeley.edu
UUCP:	ucbvax!bostic or seismo!keith