* [PATCH iproute2] tc/mqprio: Print extra info on invalid args.
@ 2018-09-05 20:24 Caleb Raitto
2018-09-06 10:39 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Caleb Raitto @ 2018-09-05 20:24 UTC (permalink / raw)
To: stephen, netdev; +Cc: jhs, xiyou.wangcong, jiri, Caleb Raitto
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>
---
tc/q_mqprio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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++;
--
2.19.0.rc1.350.ge57e33dbd1-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH iproute2] tc/mqprio: Print extra info on invalid args.
2018-09-05 20:24 [PATCH iproute2] tc/mqprio: Print extra info on invalid args Caleb Raitto
@ 2018-09-06 10:39 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2018-09-06 10:39 UTC (permalink / raw)
To: Caleb Raitto; +Cc: netdev, jhs, xiyou.wangcong, jiri, Caleb Raitto
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?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-06 15:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-05 20:24 [PATCH iproute2] tc/mqprio: Print extra info on invalid args Caleb Raitto
2018-09-06 10:39 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).