diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-31 01:38:30 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-31 01:38:30 +0000 |
commit | e7000e01189d78586139d33cb3159585d9078e4c (patch) | |
tree | 2186357aa0ea264bf8e5a46771837cada8a171be | |
parent | 251468f113b0350679404e3bf261ecbb30dbeb27 (diff) | |
download | coreutils-e7000e01189d78586139d33cb3159585d9078e4c.tar.xz |
(main): Use a better diagnostic when someone uses a
trailing numeric option in an invalid way.
-rw-r--r-- | src/head.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/head.c b/src/head.c index 95100250d..4038722b0 100644 --- a/src/head.c +++ b/src/head.c @@ -1,5 +1,5 @@ /* head -- output first part of file(s) - Copyright (C) 89, 90, 91, 1995-2005 Free Software Foundation, Inc. + Copyright (C) 89, 90, 91, 1995-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -973,7 +973,7 @@ main (int argc, char **argv) break; default: - error (0, 0, _("unrecognized option `-%c'"), *a); + error (0, 0, _("invalid trailing option -- %c"), *a); usage (EXIT_FAILURE); } } @@ -992,7 +992,8 @@ main (int argc, char **argv) argc--; } - while ((c = getopt_long (argc, argv, "c:n:qv", long_options, NULL)) != -1) + while ((c = getopt_long (argc, argv, "c:n:qv0123456789", long_options, NULL)) + != -1) { switch (c) { @@ -1029,6 +1030,8 @@ main (int argc, char **argv) case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); default: + if (ISDIGIT (c)) + error (0, 0, _("invalid trailing option -- %c"), c); usage (EXIT_FAILURE); } } |