Improve th error message: add the failing option's name.
This commit is contained in:
parent
cd568e37bc
commit
b1f215149e
|
|
@ -67,10 +67,14 @@ INPdoOpts(
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
/* print err message only if it is not just a number */
|
||||||
errmsg = TMALLOC(char, 100);
|
char* ctoken = token;
|
||||||
(void) strcpy(errmsg," Error: unknown option - ignored\n");
|
while (*ctoken && strchr("0123456789.e+-", *ctoken))
|
||||||
optCard->error = INPerrCat(optCard->error,errmsg);
|
ctoken++;
|
||||||
fprintf(stderr, "%s\n", optCard->error);
|
if (*ctoken) {
|
||||||
|
errmsg = tprintf("Error: unknown option %s - ignored\n", token);
|
||||||
|
optCard->error = INPerrCat(optCard->error, errmsg);
|
||||||
|
fprintf(stderr, "%s\n", optCard->error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue