print warnings and errors to stderr

This commit is contained in:
steven-omaha
2023-02-14 12:47:41 +01:00
parent cee16bc5f8
commit c7841ae346
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -235,7 +235,7 @@ impl Pacdef {
.context("filename is not valid UTF-8")?; .context("filename is not valid UTF-8")?;
if !target.exists() { if !target.exists() {
println!("file {target_name} does not exist, skipping"); eprintln!("file {target_name} does not exist, skipping");
continue; continue;
} }
@@ -243,7 +243,7 @@ impl Pacdef {
link.push(target_name); link.push(target_name);
if link.exists() { if link.exists() {
println!("group {target_name} already exists, skipping"); eprintln!("group {target_name} already exists, skipping");
} else { } else {
symlink(target, link)?; 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}"),
} }
} }
+3 -3
View File
@@ -27,7 +27,7 @@ impl Group {
let path = file.path(); let path = file.path();
if config.warn_not_symlinks && !path.is_symlink() { if config.warn_not_symlinks && !path.is_symlink() {
println!( eprintln!(
"WARNING: group file {} is not a symlink", "WARNING: group file {} is not a symlink",
path.to_string_lossy() path.to_string_lossy()
); );
@@ -98,13 +98,13 @@ impl Group {
} }
Err(e) => { Err(e) => {
let err = e.root_cause(); 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() { if sections.is_empty() {
println!("WARNING: no sections found in group '{name}'"); eprintln!("WARNING: no sections found in group '{name}'");
} }
let path = path.into(); let path = path.into();