Skip to content

Commit

Permalink
cli: no numbers for USB and Bluetooth devices
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Feb 1, 2024
1 parent 5392eeb commit 6f764e5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/solaar/cli/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -290,25 +293,21 @@ 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)
count = d.count()
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)
Expand Down

0 comments on commit 6f764e5

Please sign in to comment.