iproute2: improved error messages
This patch improves many error messages as follows:
- For incorrect parameters, show the value of the offending parameter, rather than just say that it is incorrect
- Rephrased messages for clarity
- Rephrased to more `mainstream' english
Signed-off-by: Kees van Reeuwijk <reeuwijk@few.vu.nl>
diff --git a/ip/link_vti.c b/ip/link_vti.c
index 385f435..77a7482 100644
--- a/ip/link_vti.c
+++ b/ip/link_vti.c
@@ -117,7 +117,7 @@
else {
if (get_unsigned(&uval, *argv, 0) < 0) {
fprintf(stderr,
- "Invalid value for \"key\"\n");
+ "Invalid value for \"key\": \"%s\"; it should be an unsigned integer\n", *argv);
exit(-1);
}
uval = htonl(uval);
@@ -132,7 +132,7 @@
uval = get_addr32(*argv);
else {
if (get_unsigned(&uval, *argv, 0) < 0) {
- fprintf(stderr, "invalid value of \"ikey\"\n");
+ fprintf(stderr, "invalid value for \"ikey\": \"%s\"; it should be an unsigned integer\n", *argv);
exit(-1);
}
uval = htonl(uval);
@@ -146,7 +146,7 @@
uval = get_addr32(*argv);
else {
if (get_unsigned(&uval, *argv, 0) < 0) {
- fprintf(stderr, "invalid value of \"okey\"\n");
+ fprintf(stderr, "invalid value for \"okey\": \"%s\"; it should be an unsigned integer\n", *argv);
exit(-1);
}
uval = htonl(uval);
@@ -155,7 +155,7 @@
} else if (!matches(*argv, "remote")) {
NEXT_ARG();
if (!strcmp(*argv, "any")) {
- fprintf(stderr, "invalid value of \"remote\"\n");
+ fprintf(stderr, "invalid value for \"remote\": \"%s\"\n", *argv);
exit(-1);
} else {
daddr = get_addr32(*argv);
@@ -163,7 +163,7 @@
} else if (!matches(*argv, "local")) {
NEXT_ARG();
if (!strcmp(*argv, "any")) {
- fprintf(stderr, "invalid value of \"local\"\n");
+ fprintf(stderr, "invalid value for \"local\": \"%s\"\n", *argv);
exit(-1);
} else {
saddr = get_addr32(*argv);