Skip to content

Commit f3b8969

Browse files
committed
feat: put ads in stderr and respect --quiet
1 parent 40c2b9d commit f3b8969

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/alejandra_cli/src/cli.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,11 @@ pub fn main() -> std::io::Result<()> {
194194
(true, false) => "requires formatting",
195195
}
196196
);
197-
}
198-
if in_place {
199-
println!();
200-
print!("{}", random_ad());
197+
198+
if in_place {
199+
eprintln!();
200+
eprint!("{}", random_ad());
201+
}
201202
}
202203

203204
std::process::exit(if in_place { 0 } else { 2 });
@@ -206,8 +207,8 @@ pub fn main() -> std::io::Result<()> {
206207
if !args.quiet {
207208
eprintln!();
208209
eprintln!("Congratulations! Your code complies the Alejandra style.");
209-
println!();
210-
print!("{}", random_ad());
210+
eprintln!();
211+
eprint!("{}", random_ad());
211212
}
212213

213214
std::process::exit(0);

0 commit comments

Comments
 (0)