tuna-f1sh / cyme

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

sort by bus; device-number by default and tidy logic #33 #34

Closed tuna-f1sh closed 2 months ago

tuna-f1sh commented 2 months ago

Sorting should now match updated lsusb 1, 2, which sorts by bus and device number within bus.

Tidied up sort logic by doing in display::prepare rather than at display function. Default is now Sort::DeviceNumber to match lsusb and I think makes most sense since device number is default display block - previously would sort on Sort::BranchPosition when using --tree.

Sort::BranchPosition can still be requested by user with --sort-devices branch-position and still works as intended. Note that it will sort by parent branch number first so may not appear sorted down the tree.

Closes #33