summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2008-08-04 16:41:58 +0100
committerRichard Hughes <richard@hughsie.com>2008-08-04 16:41:58 +0100
commit9f171a14ef6b27fe1a458ded143684dc6e988886 (patch)
tree5f4c1c781ddd051fbdb4d3cdd435a7e5cae79603 /tools
parent8c4efc79f33511eafa06074357fffc2c16e8e284 (diff)
downloadupower-9f171a14ef6b27fe1a458ded143684dc6e988886.tar.gz
make devkit-power --dump work
Diffstat (limited to 'tools')
-rw-r--r--tools/dkp-tool.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/dkp-tool.c b/tools/dkp-tool.c
index 669305d..a6c7e3b 100644
--- a/tools/dkp-tool.c
+++ b/tools/dkp-tool.c
@@ -303,9 +303,7 @@ main (int argc, char **argv)
dbus_g_proxy_add_signal (power_proxy, "DeviceRemoved", G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_add_signal (power_proxy, "DeviceChanged", G_TYPE_STRING, G_TYPE_INVALID);
- if (opt_dump) {
- dkp_warning ("dump not supported");
- } else if (opt_enumerate) {
+ if (opt_enumerate || opt_dump) {
GPtrArray *devices;
if (!org_freedesktop_DeviceKit_Power_enumerate_devices (power_proxy, &devices, &error)) {
dkp_warning ("Couldn't enumerate devices: %s", error->message);
@@ -314,7 +312,12 @@ main (int argc, char **argv)
}
for (n = 0; n < devices->len; n++) {
gchar *object_path = devices->pdata[n];
- g_print ("%s\n", object_path);
+ if (opt_enumerate)
+ g_print ("%s\n", object_path);
+ else {
+ g_print ("Device: %s\n", object_path);
+ dkp_tool_show_device_info (object_path);
+ }
}
g_ptr_array_foreach (devices, (GFunc) g_free, NULL);
g_ptr_array_free (devices, TRUE);