[Nut-upsdev] [nut-commits] svn commit r1376 - in trunk: . server

Arnaud Quette aquette.dev at gmail.com
Wed Apr 2 12:38:53 UTC 2008


2008/4/1, Arjen de Korte <nut+devel at de-korte.org>:
> Arnaud Quette wrote:
>
> >
> > >  > The only cosmetic remark I have (and I don't recall if it was prev.
> > >  > there) is the non sorted list of commands that upscmd outputs...
> > >
> > >
> > > The commands are put into a linked list, where the first command in the
> > >  list will be shown first by NUT. The 'usbhid-ups' driver will add the
> > >  commands in the order they are in the HID-to-NUT mapping table. So if
> this
> > >  table is sorted, the commands will also be sorted. By their very
> nature,
> > >  the 'composite' commands are not in this table. Since we need to know
> > >  which commands are available (maybe the UPS already provides them), we
> can
> > >  add these only after the HID-to-NUT mapping is completed. Therefor,
> they
> > >  will also show up last (not sorted).
> > >
> > >  There is no easy way to change this. Probably the most elegant way to
> do
> > >  it, would be not to use a singly linked list anymore, but a sorted
> binary
> > >  tree instead (like we already do for the variables themselves), so that
> we
> > >  fix this in one go for all drivers. But I seriously doubt if this
> cosmetic
> > >  thing is worth the (coding) effort.
> > >
> > >
> >
> > well, I'm still unsure. This current unsorted version might be
> > puzzling to users.
> >
> >
>  See commit r1411 in the trunk. The command list is sorted after that. Let
> me know if you think this is worth backporting to Testing.

nice, thanks.

>  I'm still not too sure if we're doing people a favor with this, but I'll
> leave it up to you if this is a good thing or not.

I don't see your point here: having a sorted list gives a clear
picture to the user.
while an unsorted list can be disappointing.
Or have I missed something obvious?!
I'll release -pre1 this afternoon. We can still include r1411 in -pre2...

Arnaud
-- 
Linux / Unix Expert R&D - MGE Office Protection Systems - http://www.mgeops.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
Free Software Developer - http://arnaud.quette.free.fr/



More information about the Nut-upsdev mailing list