mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-14 09:36:06 +00:00
Merge pull request #859 from solidsnack/master
Write non-output to stderr when there is output
This commit is contained in:
commit
17856e8d56
@ -28,6 +28,15 @@ use std::str::FromStr;
|
||||
|
||||
use getopts::{Matches, Options};
|
||||
|
||||
macro_rules! msg {
|
||||
($($arg:tt)*) => (
|
||||
match writeln!(&mut ::std::io::stderr(), $($arg)* ) {
|
||||
Ok(_) => {},
|
||||
Err(x) => panic!("Unable to write to stderr: {}", x),
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/// Rustfmt operations.
|
||||
enum Operation {
|
||||
/// Format files and their child modules.
|
||||
@ -203,7 +212,7 @@ fn execute() -> i32 {
|
||||
path = path_tmp;
|
||||
};
|
||||
if let Some(path) = path.as_ref() {
|
||||
println!("Using rustfmt config file {}", path.display());
|
||||
msg!("Using rustfmt config file {}", path.display());
|
||||
}
|
||||
for file in files {
|
||||
// Check the file directory if the config-path could not be read or not provided
|
||||
@ -213,9 +222,9 @@ fn execute() -> i32 {
|
||||
for {}",
|
||||
file.display()));
|
||||
if let Some(path) = path_tmp.as_ref() {
|
||||
println!("Using rustfmt config file {} for {}",
|
||||
path.display(),
|
||||
file.display());
|
||||
msg!("Using rustfmt config file {} for {}",
|
||||
path.display(),
|
||||
file.display());
|
||||
}
|
||||
config = config_tmp;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user