1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-31 12:37:45 +00:00

feat: put ads in stderr and respect --quiet

This commit is contained in:
Kevin Amado 2022-08-06 11:56:35 -06:00
parent 40c2b9d4a2
commit f3b89696b6

View file

@ -194,10 +194,11 @@ pub fn main() -> std::io::Result<()> {
(true, false) => "requires formatting", (true, false) => "requires formatting",
} }
); );
}
if in_place { if in_place {
println!(); eprintln!();
print!("{}", random_ad()); eprint!("{}", random_ad());
}
} }
std::process::exit(if in_place { 0 } else { 2 }); std::process::exit(if in_place { 0 } else { 2 });
@ -206,8 +207,8 @@ pub fn main() -> std::io::Result<()> {
if !args.quiet { if !args.quiet {
eprintln!(); eprintln!();
eprintln!("Congratulations! Your code complies the Alejandra style."); eprintln!("Congratulations! Your code complies the Alejandra style.");
println!(); eprintln!();
print!("{}", random_ad()); eprint!("{}", random_ad());
} }
std::process::exit(0); std::process::exit(0);