From c7841ae346a81919c67ce9363262d201fdfe4e36 Mon Sep 17 00:00:00 2001 From: steven-omaha <35634100+steven-omaha@users.noreply.github.com> Date: Tue, 14 Feb 2023 12:47:41 +0100 Subject: [PATCH] print warnings and errors to stderr --- crates/core/src/core.rs | 6 +++--- crates/core/src/grouping/group.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/core/src/core.rs b/crates/core/src/core.rs index 6c7b923..f6749cf 100644 --- a/crates/core/src/core.rs +++ b/crates/core/src/core.rs @@ -235,7 +235,7 @@ impl Pacdef { .context("filename is not valid UTF-8")?; if !target.exists() { - println!("file {target_name} does not exist, skipping"); + eprintln!("file {target_name} does not exist, skipping"); continue; } @@ -243,7 +243,7 @@ impl Pacdef { link.push(target_name); if link.exists() { - println!("group {target_name} already exists, skipping"); + eprintln!("group {target_name} already exists, skipping"); } else { symlink(target, link)?; } @@ -319,7 +319,7 @@ fn show_error(error: &anyhow::Error, backend: &dyn Backend) { } } } - None => println!("WARNING: skipping backend '{section}': {error}"), + None => eprintln!("WARNING: skipping backend '{section}': {error}"), } } diff --git a/crates/core/src/grouping/group.rs b/crates/core/src/grouping/group.rs index f3a0d9d..33bcf6c 100644 --- a/crates/core/src/grouping/group.rs +++ b/crates/core/src/grouping/group.rs @@ -27,7 +27,7 @@ impl Group { let path = file.path(); if config.warn_not_symlinks && !path.is_symlink() { - println!( + eprintln!( "WARNING: group file {} is not a symlink", path.to_string_lossy() ); @@ -98,13 +98,13 @@ impl Group { } Err(e) => { let err = e.root_cause(); - println!("WARNING: could not process a section under group '{name}': {err}"); + eprintln!("WARNING: could not process a section under group '{name}': {err}"); } } } if sections.is_empty() { - println!("WARNING: no sections found in group '{name}'"); + eprintln!("WARNING: no sections found in group '{name}'"); } let path = path.into();