summaryrefslogtreecommitdiff
path: root/src/tail.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-01-31 01:39:10 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-01-31 01:39:10 +0000
commit4b4cc17d42c501da24bba695c01794de555ae9dd (patch)
treed685b1961d93574d032ecee1c24bbb3ca17cdf26 /src/tail.c
parente7000e01189d78586139d33cb3159585d9078e4c (diff)
downloadcoreutils-4b4cc17d42c501da24bba695c01794de555ae9dd.tar.xz
(parse_options): Use a better diagnostic when someone uses a trailing
numeric option in an invalid way.
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tail.c b/src/tail.c
index 1bfe4bb30..1718a7729 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1455,7 +1455,8 @@ parse_options (int argc, char **argv,
{
int c;
- while ((c = getopt_long (argc, argv, "c:n:fFqs:v", long_options, NULL))
+ while ((c = getopt_long (argc, argv, "c:n:fFqs:v0123456789",
+ long_options, NULL))
!= -1)
{
switch (c)
@@ -1553,6 +1554,11 @@ parse_options (int argc, char **argv,
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ error (EXIT_FAILURE, 0,
+ _("option used in invalid context -- %c"), c);
+
default:
usage (EXIT_FAILURE);
}