Subject: Re: Compressed vnd handling tested successfully
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 06/14/2005 13:23:10
> Cc: tech-kern@NetBSD.org

Hm, shouldn't this part of the discussion be somewhere else?

>> I don't see anything wrong with having one program which accepts -c
>> and -d (or whatever options are picked) and then, for certain values
>> of basename(argv[0]), supplies one or the other by default.
> Well, I guess it would break the principle of least surprise: if the
> default is to compress,

If.  No, I think the default should be more like...

 cflag = 0;
 dflag = 0;
 if (!strcmp(basename(av[0]),"vndzip")) cflag = 1;
 if (!strcmp(basename(av[0]),"vndunzip")) dflag = 1;
 ...process command-line flags...
 ... -c -> { cflag=1; dflag=0; } ...
 ... -d -> { dflag=1; cflag=0; } ...
 if (!cflag && !dflag)
  { fprintf(stderr,"%s: must give -c or -d when not run as `vndzip' or `vndunzip'\n",__progname);
    exit(1);
  }

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B