summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inotail.c8
-rw-r--r--inotail.h3
2 files changed, 9 insertions, 2 deletions
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;
diff --git a/inotail.h b/inotail.h
index b47e6a4..40b0e29 100644
--- a/inotail.h
+++ b/inotail.h
@@ -7,6 +7,9 @@
/* tail modes */
enum { M_LINES, M_BYTES };
+/* tail unit relative to the end ('-' or none) or the beginning ('+' of the file) */
+enum { R_END, R_BEGIN };
+
/* Every tailed file is represented as a file_struct */
struct file_struct {
char *name; /* Name of file (or '-' for stdin) */
+120 2016-09-21libnvdimm, namespace: debug invalid interleave-set-cookie valuesDan Williams1-1/+3 2016-09-01nvdimm: Spelling s/unacknoweldged/unacknowledged/Geert Uytterhoeven1-1/+1 2016-05-09libnvdimm, dax: introduce device-dax infrastructureDan Williams1-1/+18 2016-04-22libnvdimm: cleanup nvdimm_namespace_common_probe(), kill 'host'Dan Williams1-12/+7 2016-03-05libnvdimm, pmem: adjust for section collisions with 'System RAM'Dan Williams1-0/+7 2016-01-26libnvdimm: fix mode determination for e820 devicesDan Williams1-3/+5 2016-01-05libnvdimm: fix namespace object confusion in is_uuid_busy()Dan Williams1-0/+53 2015-12-24libnvdimm, pfn: move 'memory mode' indication to sysfsDan Williams1-13/+28 2015-12-13libnvdimm, pfn: fix pfn seed creationDan Williams1-0/+12 2015-12-08nvdimm: improve diagnosibility of namespacesDmitry Krivenok1-4/+22 2015-08-28libnvdimm, pmem: direct map legacy pmem by defaultDan Williams1-5/+30 2015-08-28libnvdimm, pfn: 'struct page' provider infrastructureDan Williams1-8/+26 2015-08-14libnvdimm, btt: write and validate parent_uuidVishal Verma1-0/+20 2015-06-26libnvdimm: Add sysfs numa_node to NVDIMM devicesToshi Kani1-0/+1 2015-06-26libnvdimm, blk: add support for blk integrityVishal Verma1-1/+2 2015-06-26libnvdimm, nfit, nd_blk: driver for BLK-mode access persistent memoryRoss Zwisler1-1/+64 2015-06-26nd_btt: atomic sector updatesVishal Verma1-0/+24 2015-06-25libnvdimm: infrastructure for btt devicesDan Williams1-34/+170 2015-06-24libnvdimm: write blk label setDan Williams1-4/+53 2015-06-24libnvdimm: write pmem label setDan Williams1-11/+72 2015-06-24libnvdimm: blk labels and namespace instantiationDan Williams1-36/+462 2015-06-24libnvdimm: pmem label sets and namespace instantiation.Dan Williams1-2/+1000 2015-06-24libnvdimm: support for legacy (non-aliasing) nvdimmsDan Williams1-0/+111