|
|
049c96 |
From a36e0ae05b37cb2055bd2a4304d43b486888d5a7 Mon Sep 17 00:00:00 2001
|
|
|
049c96 |
From: Phil Sutter <psutter@redhat.com>
|
|
|
049c96 |
Date: Wed, 24 Feb 2016 10:49:04 +0100
|
|
|
049c96 |
Subject: [PATCH] iplink: use the short format to print help info
|
|
|
049c96 |
|
|
|
049c96 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1270759
|
|
|
049c96 |
Upstream Status: iproute2.git commit 43367ef7eb047
|
|
|
049c96 |
|
|
|
049c96 |
commit 43367ef7eb0473ea4ecdc3925f076107f05873a0
|
|
|
049c96 |
Author: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
|
|
|
049c96 |
Date: Wed Aug 12 06:03:23 2015 +0000
|
|
|
049c96 |
|
|
|
049c96 |
iplink: use the short format to print help info
|
|
|
049c96 |
|
|
|
049c96 |
Allow to print link type usage by: ip link help bridge
|
|
|
049c96 |
|
|
|
049c96 |
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
|
|
|
049c96 |
---
|
|
|
049c96 |
ip/iplink_bridge.c | 16 ++++++++++++++--
|
|
|
049c96 |
1 file changed, 14 insertions(+), 2 deletions(-)
|
|
|
049c96 |
|
|
|
049c96 |
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
|
|
|
049c96 |
index 297160c..1e69960 100644
|
|
|
049c96 |
--- a/ip/iplink_bridge.c
|
|
|
049c96 |
+++ b/ip/iplink_bridge.c
|
|
|
049c96 |
@@ -17,9 +17,9 @@
|
|
|
049c96 |
#include "utils.h"
|
|
|
049c96 |
#include "ip_common.h"
|
|
|
049c96 |
|
|
|
049c96 |
-static void explain(void)
|
|
|
049c96 |
+static void print_explain(FILE *f)
|
|
|
049c96 |
{
|
|
|
049c96 |
- fprintf(stderr,
|
|
|
049c96 |
+ fprintf(f,
|
|
|
049c96 |
"Usage: ... bridge [ forward_delay FORWARD_DELAY ]\n"
|
|
|
049c96 |
" [ hello_time HELLO_TIME ]\n"
|
|
|
049c96 |
" [ max_age MAX_AGE ]\n"
|
|
|
049c96 |
@@ -29,6 +29,11 @@ static void explain(void)
|
|
|
049c96 |
);
|
|
|
049c96 |
}
|
|
|
049c96 |
|
|
|
049c96 |
+static void explain(void)
|
|
|
049c96 |
+{
|
|
|
049c96 |
+ print_explain(stderr);
|
|
|
049c96 |
+}
|
|
|
049c96 |
+
|
|
|
049c96 |
static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
|
|
|
049c96 |
struct nlmsghdr *n)
|
|
|
049c96 |
{
|
|
|
049c96 |
@@ -111,9 +116,16 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
|
|
|
049c96 |
rta_getattr_u32(tb[IFLA_BR_MAX_AGE]));
|
|
|
049c96 |
}
|
|
|
049c96 |
|
|
|
049c96 |
+static void bridge_print_help(struct link_util *lu, int argc, char **argv,
|
|
|
049c96 |
+ FILE *f)
|
|
|
049c96 |
+{
|
|
|
049c96 |
+ print_explain(f);
|
|
|
049c96 |
+}
|
|
|
049c96 |
+
|
|
|
049c96 |
struct link_util bridge_link_util = {
|
|
|
049c96 |
.id = "bridge",
|
|
|
049c96 |
.maxattr = IFLA_BR_MAX,
|
|
|
049c96 |
.parse_opt = bridge_parse_opt,
|
|
|
049c96 |
.print_opt = bridge_print_opt,
|
|
|
049c96 |
+ .print_help = bridge_print_help,
|
|
|
049c96 |
};
|
|
|
049c96 |
--
|
|
|
049c96 |
1.8.3.1
|
|
|
049c96 |
|