diff options
author | Rob Landley <rob@landley.net> | 2008-05-04 18:52:29 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2008-05-04 18:52:29 -0500 |
commit | 8e99874c4743032b9cd236c84098570e4476657a (patch) | |
tree | 46151d41c0dd0ceb794ad645f0fa2397f525ffef /lib/args.c | |
parent | 87df5f68324769631e3acb05b940b9e145551609 (diff) | |
download | toybox-8e99874c4743032b9cd236c84098570e4476657a.tar.gz |
Fluffier error message.
Diffstat (limited to 'lib/args.c')
-rw-r--r-- | lib/args.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -152,6 +152,7 @@ void get_optflags(void) struct getoptflagstate gof; long *nextarg = (long *)&this; char *options = toys.which->options; + char *letters[]={"s",""}; if (CFG_HELP) toys.exithelp++; // Allocate memory for optargs @@ -332,9 +333,11 @@ notflag: } // Sanity check - if (toys.optc<minargs) - error_exit("Need %d argument%s", minargs, minargs ? "s" : ""); + if (toys.optc<minargs) { + error_exit("Need%s %d argument%s", letters[!!(minargs-1)], minargs, + letters[!(minargs-1)]); + } if (toys.optc>maxargs) - error_exit("Max %d argument%s", maxargs, maxargs ? "s" : ""); + error_exit("Max %d argument%s", maxargs, letters[!(maxargs-1)]); if (CFG_HELP) toys.exithelp = 0; } |