mirror of
https://github.com/uutils/coreutils
synced 2024-11-15 01:17:09 +00:00
Add standard warning function in tee
This commit is contained in:
parent
2d5180be07
commit
af4092124b
1 changed files with 5 additions and 1 deletions
|
@ -25,7 +25,7 @@ static VERSION: &'static str = "1.0.0";
|
|||
fn main() {
|
||||
match options(args()).and_then(exec) {
|
||||
Err(message) => {
|
||||
error!("{}: {}", args()[0], message);
|
||||
warn(message);
|
||||
set_exit_status(1)
|
||||
},
|
||||
Ok(status) => set_exit_status(status)
|
||||
|
@ -107,3 +107,7 @@ fn tee(options: Options) -> Result<int, ~str> {
|
|||
0
|
||||
})).map_err(|err| err.desc.to_owned())
|
||||
}
|
||||
|
||||
fn warn(message: &str) {
|
||||
error!("{}: {}", args()[0], message);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue