diff --git a/src/tail/README.md b/src/tail/README.md index a31dd0702..f5c890ad2 100644 --- a/src/tail/README.md +++ b/src/tail/README.md @@ -7,7 +7,6 @@ Rudimentary tail implementation. * `--pid` : with `-f`, terminate after process ID, PID dies * `--quiet` : never output headers giving file names * `--retry` : keep trying to open a file even when it is or becomes inaccessible; useful when follow‐ing by name, i.e., with `--follow=name` -* `--verbose` : always output headers giving file names ### Others The current implementation does not handle `-` as an alias for stdin. diff --git a/src/tail/tail.rs b/src/tail/tail.rs index 05651a25d..7661ec76c 100755 --- a/src/tail/tail.rs +++ b/src/tail/tail.rs @@ -71,6 +71,7 @@ pub fn uumain(args: Vec) -> i32 { opts.optflag("z", "zero-terminated", "Line delimiter is NUL, not newline"); opts.optflag("h", "help", "help"); opts.optflag("V", "version", "version"); + opts.optflag("v", "verbose", "always output headers giving file names"); let given_options = match opts.parse(&args) { Ok (m) => { m } @@ -140,6 +141,8 @@ pub fn uumain(args: Vec) -> i32 { } } + let verbose = given_options.opt_present("v"); + let files = given_options.free; if files.is_empty() { @@ -155,7 +158,7 @@ pub fn uumain(args: Vec) -> i32 { } for filename in &files { - if multiple { + if multiple || verbose { if !first_header { println!(""); } println!("==> {} <==", filename); }