mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
ratbagctl: pick default device if none given for show-device
Lets use the new get_device_path() helper to allow calling show-device without any argument. This follows what show-profile does already. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
@@ -422,9 +422,7 @@ static int show_device_print(struct ratbagctl *ctl, const char *device)
|
||||
_cleanup_(freep) char *path = NULL;
|
||||
int r;
|
||||
|
||||
r = sd_bus_path_encode_many(&path,
|
||||
"/org/freedesktop/ratbag1/device/%",
|
||||
device);
|
||||
r = get_device_path(ctl, device, &path, &error);
|
||||
if (r < 0)
|
||||
goto exit;
|
||||
|
||||
@@ -566,10 +564,6 @@ static int verb_show_device(struct ratbagctl *ctl, int argc, char **argv)
|
||||
}
|
||||
|
||||
device = argv[optind];
|
||||
if (!device) {
|
||||
fprintf(stderr, "No device specified\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return show_device_print(ctl, device);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user