From 3bac938bf49e6e543ffeaf7bbc0e6c17f5b30416 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 26 Nov 2013 22:45:18 -0800 Subject: Print which option was in error along with usage message Signed-off-by: Alan Coopersmith --- xdriinfo.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xdriinfo.c') diff --git a/xdriinfo.c b/xdriinfo.c index 865b4bf..9118ea9 100644 --- a/xdriinfo.c +++ b/xdriinfo.c @@ -80,11 +80,15 @@ int main (int argc, char *argv[]) { func = OPTIONS; argPtr = &funcArg; } else { + fprintf (stderr, "%s: unrecognized argument '%s'\n", + argv[0], argv[i]); printUsage (); return 1; } if (argPtr) { if (++i == argc) { + fprintf (stderr, "%s: '%s' requires an argument\n", + argv[0], argv[i-1]); printUsage (); return 1; } -- cgit v1.2.3