summaryrefslogtreecommitdiff
path: root/src/network/networkctl.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-12-19 08:33:46 +0100
committerTom Gundersen <teg@jklm.no>2014-12-19 08:33:46 +0100
commit19727828d22057e9eb9160cae879ed5ced708517 (patch)
tree1abd5630ab9a80ce6746193d3e62a2ca47c5fea9 /src/network/networkctl.c
parent49699bac94d24b444274f91f85c82e6fad04d029 (diff)
networkctl: lldp - respect arg_legend
Diffstat (limited to 'src/network/networkctl.c')
-rw-r--r--src/network/networkctl.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 74735effcc..21e9b383b2 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -927,11 +927,8 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
if (c < 0)
return rtnl_log_parse_error(c);
- printf("Capability Codes: (O) - Other, (P) - Repeater, (B) - Bridge , (W) - WLAN Access Point, (R) = Router, (T) - Telephone,\n"
- "(D) - Data Over Cable Service Interface Specifications, (A) - Station, (C) - Customer VLAN, (S) - Service VLAN,\n"
- "(M) - Two-port MAC Relay (TPMR)\n\n");
-
- printf("%s %16s %24s %16s %16s\n", "Local Intf", "Device ID", "Port ID", "TTL", "Capability");
+ if (arg_legend)
+ printf("%s %16s %24s %16s %16s\n", "Local Intf", "Device ID", "Port ID", "TTL", "Capability");
for (i = j = 0; i < c; i++) {
_cleanup_free_ char *chassis = NULL, *port = NULL, *cap = NULL, *lldp = NULL;
@@ -995,7 +992,14 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
}
}
- printf("\nTotal entries displayed: %d\n", j);
+ if (arg_legend) {
+ printf("\nCapability Codes:\n"
+ "(O) - Other, (P) - Repeater, (B) - Bridge , (W) - WLAN Access Point, (R) = Router,\n"
+ "(T) - Telephone, (D) - Data Over Cable Service Interface Specifications, (A) - Station,\n"
+ "(C) - Customer VLAN, (S) - Service VLAN, (M) - Two-port MAC Relay (TPMR)\n\n");
+
+ printf("Total entries displayed: %d\n", j);
+ }
return 0;
}