diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2006-10-20 17:55:55 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2006-10-20 17:55:55 +0200 |
commit | 3e1ce3d550b37d6f833c01860b24166a89908576 (patch) | |
tree | c283d2e975947dc177569589a3fc339738969815 /inotail.c | |
parent | a1b88302d515b04255b5bd164378ee15d4c69a11 (diff) |
inotail.c: Add basic support for +/-<num> to -c/-n
Diffstat (limited to 'inotail.c')
-rw-r--r-- | inotail.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; |