tuna-f1sh / cyme

List system USB buses and devices; a lib and modern cross-platform lsusb that attempts to maintain compatibility with, but also add new features
GNU General Public License v3.0
141 stars 7 forks source link

Truncate very long fields #8

Closed dmezh closed 1 year ago

dmezh commented 1 year ago

Hey, amazing work on this; I like it a lot! I suggest truncating very long names and maybe other fields - motivating example:

image

That one device with the extremely long name is pushing the serial column off to the side and hurting readability. I would prefer the name ends in a ... after some default max, and a flag to never truncate.

tuna-f1sh commented 1 year ago

Yes this is a good idea. It's actually something I have in my list of features to implement - some terminal width detection and auto-scaling. But as you say, a fixed max also makes sense for descriptor strings.

I'll have a look into it next time I get chance.

tuna-f1sh commented 1 year ago

I had added this and whilst I was at it, added a default auto-width feature that will find the max based on terminal width. See: https://github.com/tuna-f1sh/cyme/releases/tag/v1.3.1