From: Jim Meyering Date: Sun, 7 Apr 1996 17:46:03 +0000 (+0000) Subject: (usage): Give minimal description of the program. X-Git-Tag: TEXTUTILS-1_14b~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e76b8b7daf9971b93191039d0a77e856733e735;p=thirdparty%2Fcoreutils.git (usage): Give minimal description of the program. (print_factors): Give a better diagnostic. (main): Suggest --help upon failure. Reported by Karl Eichwalder . --- diff --git a/src/factor.c b/src/factor.c index a152eb8d03..db5d68cd74 100644 --- a/src/factor.c +++ b/src/factor.c @@ -71,6 +71,9 @@ Usage: %s [NUMBER...]\n\ \n\ --help display this help and exit\n\ --version output version information and exit\n\ +\n\ + Print the prime factors of all specified integer NUMBERs. If no arguments\n\ + are specified on the command line, they are read from standard input.\n\ ")); } exit (status); @@ -133,7 +136,7 @@ print_factors (const char *s) if (xstrtoul (s, NULL, 10, &n, NULL) != LONGINT_OK) { - error (0, 0, _("%s: invalid argument"), s); + error (0, 0, _("`%s' is not a valid positive integer"), s); return 1; } n_factors = factor (n, MAX_N_FACTORS, factors); @@ -188,6 +191,8 @@ main (int argc, char **argv) for (i = 1; i < argc; i++) fail |= print_factors (argv[i]); } + if (fail) + usage (1); exit (fail); }