mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 01:38:04 +00:00
commit
eebfc69397
2 changed files with 4 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -71,6 +71,7 @@ pub fn uumain(args: Vec<String>) -> 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<String>) -> 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<String>) -> i32 {
|
|||
}
|
||||
|
||||
for filename in &files {
|
||||
if multiple {
|
||||
if multiple || verbose {
|
||||
if !first_header { println!(""); }
|
||||
println!("==> {} <==", filename);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue