summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2010-09-24 14:38:50 +0200
committerJiří Klimeš <jklimes@redhat.com>2010-09-24 14:38:50 +0200
commitb3aa9473c5d06988c79fe569a5eb5a677164dc09 (patch)
tree11bb46846688f055af18ad6f678771ef83d00d85 /cli
parent8199c7275b51f42f8417bb0807b2aa1bb2cd6df7 (diff)
downloadNetworkManager-b3aa9473c5d06988c79fe569a5eb5a677164dc09.tar.gz
cli: add D-Bus object path field for devices (e.g.: nmcli -f device,dbus-path dev status)
Diffstat (limited to 'cli')
-rw-r--r--cli/src/devices.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/cli/src/devices.c b/cli/src/devices.c
index 7c9dcc5210..436b4b6eb8 100644
--- a/cli/src/devices.c
+++ b/cli/src/devices.c
@@ -58,12 +58,13 @@
/* Available fields for 'dev status' */
static NmcOutputField nmc_fields_dev_status[] = {
- {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 0 */
- {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 1 */
- {"STATE", N_("STATE"), 12, NULL, 0}, /* 2 */
- {NULL, NULL, 0, NULL, 0}
+ {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 0 */
+ {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 1 */
+ {"STATE", N_("STATE"), 13, NULL, 0}, /* 2 */
+ {"DBUS-PATH", N_("DBUS-PATH"), 43, NULL, 0}, /* 3 */
+ {NULL, NULL, 0, NULL, 0}
};
-#define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE"
+#define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE,DBUS-PATH"
#define NMC_FIELDS_DEV_STATUS_COMMON "DEVICE,TYPE,STATE"
@@ -763,6 +764,7 @@ show_device_status (NMDevice *device, NmCli *nmc)
nmc->allowed_fields[0].value = nm_device_get_iface (device);
nmc->allowed_fields[1].value = get_device_type (device);
nmc->allowed_fields[2].value = device_state_to_string (nm_device_get_state (device));
+ nmc->allowed_fields[3].value = nm_object_get_path (NM_OBJECT (device));
nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */
print_fields (nmc->print_fields, nmc->allowed_fields);