Message ID | 20180905202419.238812-1-caleb.raitto@gmail.com |
---|---|
State | Changes Requested, archived |
Delegated to: | stephen hemminger |
Headers | show |
Series | [iproute2] tc/mqprio: Print extra info on invalid args. | expand |
On Wed, 5 Sep 2018 13:24:19 -0700 Caleb Raitto <caleb.raitto@gmail.com> wrote: > From: Caleb Raitto <caraitto@google.com> > > Print the name of the argument that wasn't understood, and also print > the usage string. > > Signed-off-by: Caleb Raitto <caraitto@google.com> The standard code pattern in iproute2 is to use invarg(). Why not use that?
diff --git a/tc/q_mqprio.c b/tc/q_mqprio.c index 89b46002..cf2eceb4 100644 --- a/tc/q_mqprio.c +++ b/tc/q_mqprio.c @@ -167,7 +167,8 @@ static int mqprio_parse_opt(struct qdisc_util *qu, int argc, explain(); return -1; } else { - fprintf(stderr, "Unknown argument\n"); + fprintf(stderr, "Unknown argument: %s\n", *argv); + explain(); return -1; } argc--; argv++;