On Wed, May 13, 2009 at 03:18:05PM +0200, Mark Kettenis wrote:
> > Date: Wed, 13 May 2009 14:28:06 +0200
> > From: Otto Moerbeek <[email protected]>
> >
> > On Wed, May 13, 2009 at 02:16:49PM +0200, Mark Kettenis wrote:
> >
> > > > Date: Wed, 13 May 2009 12:20:44 +0200
> > > > From: Otto Moerbeek <[email protected]>
> > > >
> > > > On Wed, May 13, 2009 at 12:11:35PM +0200, Peter J. Philipp wrote:
> > > >
> > > > > On Wed, May 13, 2009 at 10:40:13AM +0200, Otto Moerbeek wrote:
> > > > > > Come to think of it, why don't you just
> > > > > > putchar(tolower(hf->name[i]))
> > > > > > in a loop? Saves you the calloc and error handling.
> > > > > >
> > > > > > Also, don't forget to fix usage().
> > > > > >
> > > > > > -Otto
> > > > >
> > > > > Yeah, thanks. Well I got good and critical feedback and Otto's
> > > > > prodding was
> > > > > good enough to make me rewrite this puny patch. Gone are errno,
> > > > > calloc() and
> > > > > in is the putchar(). I stayed away from adding sthen's idea, perhaps
> > > > > he can do
> > > > > the patch for that. Patch follows:
> > > >
> > > > You forgot to fix usage(). Also, I think it makes sense to allow -l
> > > > for sum(1) too, so that both commands that take -a also take -l.
> > >
> > > That may be true, but I'm fairly certain that we will not add the -l
> > > option to either cksum(1) or sum(1). It's not defined by POSIX, nor
> > > is it commonly available on other Unix-like systems. Our goal is to
> > > not introduce non-standard options since people will start using them
> > > in scripts that will become unportable.
> >
> > in the case of sum(1) and chsum(1) we aready deviate a lot. Posix does
> > not define any options for cksum(1) and does not define sum(1) at all.
> > We accept about a dozen options to both.
>
> I'm afraid, that's not an excuse for adding even more options.
>
> > And I seem to remember the diff was inspired by Solaris.
>
> $ uname -a
> SunOS foo 5.10 Generic_127128-11 i86pc i386 i86pc
> $ cksum -l
> cksum: illegal option -- l
> Usage: cksum [file ...]
It was the digest(1) command on solaris, i remembered that wrong.
Anyway, my point is that the cksum(1) already has a bunch of options
but also an obviously missing one. But an alternative would be to do what
sthen suggested and put the algorithm list into the usage and only
that.
-Otto