From 6f764e58c98b56be05ce724b467dfc18acbd1e99 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Thu, 1 Feb 2024 08:43:41 -0500 Subject: [PATCH] cli: no numbers for USB and Bluetooth devices --- lib/solaar/cli/show.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/solaar/cli/show.py b/lib/solaar/cli/show.py index 9d4e1fd0c5..01197127f8 100644 --- a/lib/solaar/cli/show.py +++ b/lib/solaar/cli/show.py @@ -89,7 +89,10 @@ def _print_device(dev, num=None): print(' %s: Device not found' % num or dev.number) return - print(' %d: %s' % (num or dev.number, dev.name)) + if num or dev.number < 8: + print(' %d: %s' % (num or dev.number, dev.name)) + else: + print('%s' % dev.name) print(' Device path :', dev.path) if dev.wpid: print(' WPID : %s' % dev.wpid) @@ -290,7 +293,6 @@ def run(devices, args, find_receiver, find_device): device_name = args.device.lower() if device_name == 'all': - dev_num = 1 for d in devices: if isinstance(d, _receiver.Receiver): _print_receiver(d) @@ -298,17 +300,14 @@ def run(devices, args, find_receiver, find_device): if count: for dev in d: print('') - _print_device(dev) + _print_device(dev, dev.number) count -= 1 if not count: break print('') else: - if dev_num == 1: - print('USB and Bluetooth Devices') print('') - _print_device(d, num=dev_num) - dev_num += 1 + _print_device(d) return dev = find_receiver(devices, device_name)