From 3e1ce3d550b37d6f833c01860b24166a89908576 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 20 Oct 2006 17:55:55 +0200 Subject: inotail.c: Add basic support for +/- to -c/-n --- inotail.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'inotail.c') diff --git a/inotail.c b/inotail.c index 1c5f8f0..123a3fa 100644 --- a/inotail.c +++ b/inotail.c @@ -328,8 +328,8 @@ int main(int argc, char **argv) { int i, c, ret = 0; int n_files = 0; - unsigned int n_units = DEFAULT_N_LINES; - char forever = 0, mode = M_LINES; + int n_units = DEFAULT_N_LINES; + char forever = 0, mode = M_LINES, relative = R_END; char **filenames; struct file_struct *files; @@ -339,6 +339,10 @@ int main(int argc, char **argv) case 'n': if (c == 'c') mode = M_BYTES; + if (*optarg == '+') + relative = R_BEGIN; + else if (*optarg == '-') + optarg++; n_units = strtoul(optarg, NULL, 0); if (n_units < 0) n_units = 0; -- cgit v1.2.3-54-g00ecf ='h' onchange='this.form.submit();'> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode: