summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGemmarx <gemmarx@users.noreply.github.com>2016-07-31 04:12:03 +0900
committerGemmarx <gemmarx@users.noreply.github.com>2016-07-31 04:12:03 +0900
commit8d25719b6bb33ad0e539fb4d7e00e2eb111320ac (patch)
tree53db3bc3bbd4f3b55831fd058db4e7ea6e05c06d
parent6522337463264b544efbcd109f70e8334155495e (diff)
Change to put error messages into stderr
-rw-r--r--src/exa.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/exa.rs b/src/exa.rs
index be3bd85..343b67c 100644
--- a/src/exa.rs
+++ b/src/exa.rs
@@ -20,7 +20,7 @@ extern crate zoneinfo_compiled;
#[macro_use] extern crate lazy_static;
use std::ffi::OsStr;
-use std::io::{Write, Result as IOResult};
+use std::io::{stderr, Write, Result as IOResult};
use std::path::{Component, Path};
use fs::{Dir, File};
@@ -72,13 +72,13 @@ impl<'w, W: Write + 'w> Exa<'w, W> {
for file_name in self.args.iter() {
match File::from_path(Path::new(&file_name), None) {
Err(e) => {
- try!(writeln!(self.writer, "{}: {}", file_name, e));
+ try!(writeln!(stderr(), "{}: {}", file_name, e));
},
Ok(f) => {
if f.is_directory() && !self.options.dir_action.treat_dirs_as_files() {
match f.to_dir(self.options.should_scan_for_git()) {
Ok(d) => dirs.push(d),
- Err(e) => try!(writeln!(self.writer, "{}: {}", file_name, e)),
+ Err(e) => try!(writeln!(stderr(), "{}: {}", file_name, e)),
}
}
else {
@@ -122,7 +122,7 @@ impl<'w, W: Write + 'w> Exa<'w, W> {
for file in dir.files() {
match file {
Ok(file) => children.push(file),
- Err((path, e)) => try!(writeln!(self.writer, "[{}: {}]", path.display(), e)),
+ Err((path, e)) => try!(writeln!(stderr(), "[{}: {}]", path.display(), e)),
}
};
@@ -137,7 +137,7 @@ impl<'w, W: Write + 'w> Exa<'w, W> {
for child_dir in children.iter().filter(|f| f.is_directory()) {
match child_dir.to_dir(false) {
Ok(d) => child_dirs.push(d),
- Err(e) => try!(writeln!(self.writer, "{}: {}", child_dir.path.display(), e)),
+ Err(e) => try!(writeln!(stderr(), "{}: {}", child_dir.path.display(), e)),
}
}