tools: print an error if no supported devices are found

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2015-08-20 08:07:37 +10:00
parent 0a683e3cc6
commit b1ae0682bd

View File

@@ -451,6 +451,7 @@ ratbag_cmd_list_supported_devices(struct ratbag *ratbag, uint32_t flags, int arg
struct ratbag_device *device;
char path[256];
int n, i;
int supported = 0;
if (argc != 0) {
usage();
@@ -468,11 +469,15 @@ ratbag_cmd_list_supported_devices(struct ratbag *ratbag, uint32_t flags, int arg
if (device) {
printf("%s:\t%s\n", path, ratbag_device_get_name(device));
device = ratbag_device_unref(device);
supported++;
}
free(input_list[i]);
}
free(input_list);
if (!supported)
printf("No supported devices found\n");
return 0;
}