[Nut-upsdev] [nut-commits] svn commit r1376 - in trunk: . server
Arjen de Korte
nut+devel at de-korte.org
Tue Apr 1 20:08:34 UTC 2008
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.
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.
Best regards, Arjen
More information about the Nut-upsdev
mailing list