summaryrefslogtreecommitdiff
path: root/src/tail.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-11-03 13:06:50 +0000
committerJim Meyering <jim@meyering.net>1999-11-03 13:06:50 +0000
commit1c04247f533ffb16e32b832a5ae2165b5e5abb9d (patch)
tree9f26a7646f0adc116f14f9aa8908f4594fb9706e /src/tail.c
parentfcbef3a982497273deea2a0b50f2d52bbfdc497b (diff)
downloadcoreutils-1c04247f533ffb16e32b832a5ae2165b5e5abb9d.tar.xz
Fix so that `tail -fn 2 file' works again.
(anonymous enum) [LONG_FOLLOW_OPTION]: Define. (long_options): Use LONG_FOLLOW_OPTION here, instead of 'f'. (main): Remove the `::' after the `f' in getopt_long string. Add `case LONG_FOLLOW_OPTION' after `case 'f':'. Based on a patch from Tim Waugh.
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tail.c b/src/tail.c
index 48cefde05..8179f5c8b 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -194,6 +194,7 @@ enum
MAX_UNCHANGED_STATS_OPTION,
MAX_CONSECUTIVE_SIZE_CHANGES_OPTION,
PID_OPTION,
+ LONG_FOLLOW_OPTION,
};
static struct option const long_options[] =
@@ -202,7 +203,7 @@ static struct option const long_options[] =
FIXME: remove it some day */
{"allow-missing", no_argument, NULL, RETRY_OPTION},
{"bytes", required_argument, NULL, 'c'},
- {"follow", optional_argument, NULL, 'f'},
+ {"follow", optional_argument, NULL, LONG_FOLLOW_OPTION},
{"lines", required_argument, NULL, 'n'},
{"max-unchanged-stats", required_argument, NULL, MAX_UNCHANGED_STATS_OPTION},
{"max-consecutive-size-changes", required_argument, NULL,
@@ -1312,7 +1313,7 @@ parse_options (int argc, char **argv,
count_lines = 1;
forever = from_start = print_headers = 0;
- while ((c = getopt_long (argc, argv, "c:n:f::qs:v", long_options, NULL))
+ while ((c = getopt_long (argc, argv, "c:n:fqs:v", long_options, NULL))
!= -1)
{
switch (c)
@@ -1351,6 +1352,7 @@ parse_options (int argc, char **argv,
break;
case 'f':
+ case LONG_FOLLOW_OPTION:
forever = 1;
if (optarg == NULL)
follow_mode = DEFAULT_FOLLOW_MODE;