packages: cmd_list_{devices,flavours}(): error on empty results
This commit is contained in:
parent
34ffbfb0bf
commit
c0b3b15260
2 changed files with 5 additions and 1 deletions
|
@ -158,7 +158,9 @@ def get_profile_device(profile_name: Optional[str] = None, hint_or_set_arch: boo
|
||||||
|
|
||||||
@click.command(name='list')
|
@click.command(name='list')
|
||||||
def cmd_devices_list():
|
def cmd_devices_list():
|
||||||
'list the available flavours and descriptions'
|
'list the available devices and descriptions'
|
||||||
devices = get_devices()
|
devices = get_devices()
|
||||||
|
if not devices:
|
||||||
|
raise Exception("No devices found!")
|
||||||
for d in sorted(devices.keys()):
|
for d in sorted(devices.keys()):
|
||||||
print(devices[d])
|
print(devices[d])
|
||||||
|
|
|
@ -81,5 +81,7 @@ def get_profile_flavour(profile_name: Optional[str] = None) -> Flavour:
|
||||||
def cmd_flavours_list():
|
def cmd_flavours_list():
|
||||||
'list information about available flavours'
|
'list information about available flavours'
|
||||||
flavours = get_flavours()
|
flavours = get_flavours()
|
||||||
|
if not flavours:
|
||||||
|
raise Exception("No flavours found!")
|
||||||
for f in flavours.values():
|
for f in flavours.values():
|
||||||
print(f)
|
print(f)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue