+Fri Oct 21 00:57:23 1994 Jim Meyering (meyering@comco.com)
+
+ * basename.c, dirname.c, expr.c, pathchk.c, sleep.c (main): Diagnose
+ wrong number of argument -- usually too few -- instead of just
+ referring the user to the --help option. Reported by Karl Berry.
+
Mon Oct 17 23:55:41 1994 Jim Meyering (meyering@comco.com)
* doc/Makefile.in (install): Install the info files from either
#include "long-options.h"
char *basename ();
+void error ();
void strip_trailing_slashes ();
static void remove_suffix ();
parse_long_options (argc, argv, "basename", version_string, usage);
if (argc == 1 || argc > 3)
- usage (1);
+ {
+ error (0, 0, "too %s arguments", argc == 1 ? "few" : "many");
+ usage (1);
+ }
strip_trailing_slashes (argv[1]);
#include "version.h"
#include "long-options.h"
+void error ();
void strip_trailing_slashes ();
/* The name this program was run with. */
parse_long_options (argc, argv, "dirname", version_string, usage);
if (argc != 2)
- usage (1);
+ {
+ error (0, 0, "too %s arguments", argc < 2 ? "few" : "many");
+ usage (1);
+ }
path = argv[1];
strip_trailing_slashes (path);
parse_long_options (argc, argv, "expr", version_string, usage);
if (argc == 1)
- usage (1);
+ {
+ error (0, 0, "too few arguments");
+ usage (1);
+ }
+
args = argv + 1;
v = eval ();
usage (0);
if (optind == argc)
- usage (1);
+ {
+ error (0, 0, "too few arguments");
+ usage (1);
+ }
for (; optind < argc; ++optind)
exit_status |= validate_path (argv[optind], check_portability);
if (argc == 1)
{
- fprintf (stderr, "Usage: %s number[smhd]...\n", argv[0]);
- exit (1);
+ error (0, 0, "too few arguments");
+ usage (1);
}
for (i = 1; i < argc; i++)