Return after usage() for "help" in the qdisc and class add paths and in
the qdisc, class and filter show paths, as tc_filter_modify() does. Today
# tc qdisc add dev lo root handle 1: help pfifo
prints the usage and then adds the pfifo, and
# tc qdisc show dev lo help
prints the usage and then the qdiscs.
Signed-off-by: Dave Seddon <dave…@gmail.com>
---
tc/tc_class.c | 2 ++
tc/tc_filter.c | 1 +
tc/tc_qdisc.c | 2 ++
3 files changed, 5 insertions(+)
diff --git a/tc/tc_class.c b/tc/tc_class.c
index 82f0f85e..7f9c961d 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -104,6 +104,7 @@ static int tc_class_modify(int cmd, unsigned int flags, int argc, char **argv)
return -1;
} else if (matches(*argv, "help") == 0) {
usage();
+ return 0;
} else {
strncpy(k, *argv, sizeof(k)-1);
@@ -435,6 +436,7 @@ static int tc_class_list(int argc, char **argv)
req.t.tcm_parent = handle;
} else if (matches(*argv, "help") == 0) {
usage();
+ return 0;
} else {
fprintf(stderr, "What is \"%s\"? Try \"tc class help\".\n", *argv);
return -1;
diff --git a/tc/tc_filter.c b/tc/tc_filter.c
index 7b504029..a67288e4 100644
--- a/tc/tc_filter.c
+++ b/tc/tc_filter.c
@@ -690,6 +690,7 @@ static int tc_filter_list(int cmd, int argc, char **argv)
filter_chain_index = chain_index;
} else if (matches(*argv, "help") == 0) {
usage();
+ return 0;
} else {
fprintf(stderr,
" What is \"%s\"? Try \"tc filter help\"\n",
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index 7c3e7cb3..18818fbf 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -132,6 +132,7 @@ static int tc_qdisc_modify(int cmd, unsigned int flags, int argc, char **argv)
invarg("invalid egress block index value", *argv);
} else if (matches(*argv, "help") == 0) {
usage();
+ return 0;
} else {
strncpy(k, *argv, sizeof(k)-1);
@@ -398,6 +399,7 @@ static int tc_qdisc_list(int argc, char **argv)
filter_handle = handle;
} else if (matches(*argv, "help") == 0) {
usage();
+ return 0;
} else if (strcmp(*argv, "invisible") == 0) {
dump_invisible = true;
} else {
--
2.56.0