From 15d326027827c168511f923e72c64e2131515e19 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 4 Nov 2013 23:14:22 -0800 Subject: Print which option was in error along with usage message Signed-off-by: Alan Coopersmith Reviewed-by: Gaetan Nadon --- bmtoa.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bmtoa.c') diff --git a/bmtoa.c b/bmtoa.c index 0394038..a9de614 100644 --- a/bmtoa.c +++ b/bmtoa.c @@ -130,10 +130,16 @@ main (int argc, char *argv[]) filename = NULL; continue; case 'c': - if (++i >= argc) usage (); + if (++i >= argc) { + fprintf(stderr, "%s: -chars requires an argument\n", + ProgramName); + usage (); + } chars = argv[i]; continue; default: + fprintf(stderr, "%s: unrecognized option '%s'\n", + ProgramName, argv[i]); usage (); } } else { -- cgit v1.2.3