Signed-off-by: Mantas Mikulėnas <grawity@xxxxxxxxx> --- lsusb.py.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lsusb.py.in b/lsusb.py.in index b85d770..ccbfadb 100644 --- a/lsusb.py.in +++ b/lsusb.py.in @@ -477,6 +477,9 @@ class UsbDevice: usbdev.read(dirent) usbdev.readchildren() self.children.append(usbdev) + usbsortkey = lambda obj: [int(x) for x in re.split(r"[-:.]", obj.fname)] + self.interfaces.sort(key=usbsortkey) + self.children.sort(key=usbsortkey) def __str__(self): #str = " " * self.level + self.fname -- 2.21.0