Skip to contentSkip to conversation

add help command to bonding master

PATCH Applied Jiri Pirko 3 participants 4 messages Sep 5, 2014 – Sep 28, 2014

Subsystems (2)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 add help command to bonding master

---
 ip/iplink_bond.c | 3 +++
 1 file changed, 3 insertions(+)
ip/iplink_bond.c +3 -0
index b5c511e..0a1ed03 100644
@@ -339,6 +339,9 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
 			}
 			ad_select = get_index(ad_select_tbl, *argv);
 			addattr8(n, 1024, IFLA_BOND_AD_SELECT, ad_select);
+		} else if (matches(*argv, "help") == 0) {
+			explain();
+			return -1;
 		} else {
 			fprintf(stderr, "bond: unknown command \"%s\"?\n", *argv);
 			explain();
Signature · 1 line
1.9.3
#1 lore raw

Sorry, may be this is not related to this particular patch:

would not it better to use usage() name instead of explain() as it
is used everywhere ?

Quoted 26 lines · Jiri Pirko
---
 ip/iplink_bond.c | 3 +++
 1 file changed, 3 insertions(+)
ip/iplink_bond.c +3 -1
index b5c511e..0a1ed03 100644
@@ -339,6 +339,9 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
                        }
                        ad_select = get_index(ad_select_tbl, *argv);
                        addattr8(n, 1024, IFLA_BOND_AD_SELECT, ad_select);
+               } else if (matches(*argv, "help") == 0) {
+                       explain();
+                       return -1;
                } else {
                        fprintf(stderr, "bond: unknown command \"%s\"?\n", *argv);
                        explain();
--

1.9.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw
Quoted 4 lines · Fri, Sep 05, 2014 at 03:41:14PM CEST, [email protected] wrote:

Sorry, may be this is not related to this particular patch:

would not it better to use usage() name instead of explain() as it
is used everywhere ?

Well, yes, that is certainly doable. Feel free to send patch.

Quoted 28 lines · Jiri Pirko
Quoted 26 lines
---
 ip/iplink_bond.c | 3 +++
 1 file changed, 3 insertions(+)
ip/iplink_bond.c +3 -1
index b5c511e..0a1ed03 100644
@@ -339,6 +339,9 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
                        }
                        ad_select = get_index(ad_select_tbl, *argv);
                        addattr8(n, 1024, IFLA_BOND_AD_SELECT, ad_select);
+               } else if (matches(*argv, "help") == 0) {
+                       explain();
+                       return -1;
                } else {
                        fprintf(stderr, "bond: unknown command \"%s\"?\n", *argv);
                        explain();
--

1.9.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Jiri Pirko
Quoted 10 lines · On Fri, 5 Sep 2014 15:24:16 +0200 Jiri Pirko <[email protected]> wrote:
---
 ip/iplink_bond.c | 3 +++
 1 file changed, 3 insertions(+)
ip/iplink_bond.c +0 -0
index b5c511e..0a1ed03 100644

ip/iplink_bond.c static int bond_parse_opt(struct link_util *lu, int argc, char **argv, · line 347

Quoted 9 lines
ip/iplink_bond.c +3 -0
@@ -339,6 +339,9 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
 			}
 			ad_select = get_index(ad_select_tbl, *argv);
 			addattr8(n, 1024, IFLA_BOND_AD_SELECT, ad_select);
+		} else if (matches(*argv, "help") == 0) {
+			explain();
+			return -1;
 		} else {
 			fprintf(stderr, "bond: unknown command \"%s\"?\n", *argv);
 			explain();

Applied