changeset 127:343117774a9f

Fix "Need 1 arguments".
author Rob Landley <rob@landley.net>
date Mon, 18 Jun 2007 00:12:43 -0400
parents 7b22987a7b47
children 0a90a5fbc1bf
files lib/args.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/args.c	Fri Jun 15 15:16:46 2007 -0400
+++ b/lib/args.c	Mon Jun 18 00:12:43 2007 -0400
@@ -296,8 +296,10 @@
 	}
 
 	// Sanity check
-	if (optarg<minargs) error_exit("Need %d arguments", minargs);
-	if (optarg>maxargs) error_exit("Max %d arguments", maxargs);
+	if (optarg<minargs)
+		error_exit("Need %d argument%s", minargs, minargs ? "s" : "");
+	if (optarg>maxargs)
+		error_exit("Max %d argument%s", maxargs, maxargs ? "s" : "");
 }
 
 // Loop through files listed on the command line