1
0
forked from drath/libratbag

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:
David Herrmann
2015-09-29 19:02:12 +02:00
parent acb0118897
commit 958e86f67e

View File

@@ -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);
}