From ceca84b2b3cca9c6edd23af297665f417eba10e2 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Wed, 29 May 2024 09:39:07 +0100 Subject: [PATCH] feat: eprintln! instead of println! with errors --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 26e14f0..f87c615 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,8 +47,8 @@ fn vaporise() -> Result<()> { let args = Args::parse(); if args.targets.is_empty() { - println!("{} no arguments passed", "error:".red().bold()); - println!( + eprintln!("{} no arguments passed", "error:".red().bold()); + eprintln!( "{} try 'vpr -h' for more information", "note:".cyan().bold() ); @@ -78,7 +78,7 @@ fn vaporise() -> Result<()> { .with_context(|| format!("could not remove file: {}", target.bold()))?; } } else { - println!( + eprintln!( "{} the specified target does not exist: {}", "error:".red().bold(), target.yellow() @@ -91,6 +91,6 @@ fn vaporise() -> Result<()> { fn main() { if let Err(error) = vaporise() { - println!("{} {:?}", "error:".red().bold(), error); + eprintln!("{} {:?}", "error:".red().bold(), error); } }