From 5bdeabbe760149216716b258aab407a0c5ae559c Mon Sep 17 00:00:00 2001 From: Valerie Wolfe Date: Fri, 12 Jul 2024 10:46:25 -0400 Subject: [PATCH] all: errors now print to stderr instead of stdout --- env-share/Cargo.toml | 2 +- env-share/src/error.rs | 6 +++--- mkwin/Cargo.toml | 2 +- mkwin/src/error.rs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/env-share/Cargo.toml b/env-share/Cargo.toml index 770a857..8ab2adc 100644 --- a/env-share/Cargo.toml +++ b/env-share/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "env-share" -version = "0.0.1" +version = "0.0.2" edition = "2021" [profile.release] diff --git a/env-share/src/error.rs b/env-share/src/error.rs index a073c47..612815e 100644 --- a/env-share/src/error.rs +++ b/env-share/src/error.rs @@ -1,18 +1,18 @@ use std::process::exit; pub fn file_unset() { - println!("env-share: ENV_SHARE_FILE is unset"); + eprintln!("env-share: ENV_SHARE_FILE is unset"); exit(1); } pub fn vars_unset() { - println!("env-share: ENV_SHARE_VARS is unset"); + eprintln!("env-share: ENV_SHARE_VARS is unset"); exit(1); } pub fn write_fail(file: &String) { - println!("env-share: failed to write to '{file}'"); + eprintln!("env-share: failed to write to '{file}'"); exit(2); } diff --git a/mkwin/Cargo.toml b/mkwin/Cargo.toml index 0b1e5b4..98558ca 100644 --- a/mkwin/Cargo.toml +++ b/mkwin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mkwin" -version = "0.0.4" +version = "0.0.5" edition = "2021" [dependencies] diff --git a/mkwin/src/error.rs b/mkwin/src/error.rs index 796547a..846abef 100644 --- a/mkwin/src/error.rs +++ b/mkwin/src/error.rs @@ -4,13 +4,13 @@ use std::process::exit; /// no argument for target; code 1 pub fn missing_target() { - println!("mkwin: missing target"); + eprintln!("mkwin: missing target"); exit(1); } /// failed to canonicalize target path; code 2 pub fn canonicalize_fail(target: String) { - println!("mkwin: failed to canonicalze '{target}'--does the file exist?"); + eprintln!("mkwin: failed to canonicalze '{target}'--does the file exist?"); exit(2); }