From e05f117def70f87f84904e928e3eb19775794578 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Tue, 30 Jan 2024 14:26:02 -0500 Subject: [PATCH] Print errors to stderr instead of stdout --- src/main.rs | 7 ++++++- src/util.rs | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 28f8afa..1cb95c4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -144,7 +144,12 @@ fn main() { sync(&connection, get_auth_token(&config_dir), datasets, all) } - _ => println!("This feature is currently unimplemented."), + Subcommands::Ranking { + subcommand: RankingSC::Create, + dataset, + } => ranking_create(&connection, dataset), + + _ => eprintln!("This feature is currently unimplemented."), } } diff --git a/src/util.rs b/src/util.rs index f9ede46..fe037cc 100644 --- a/src/util.rs +++ b/src/util.rs @@ -10,12 +10,12 @@ pub const SECS_IN_DAY: u64 = SECS_IN_HR * 24; pub const SECS_IN_WEEK: u64 = SECS_IN_DAY * 7; pub fn error(msg: &str, code: i32) -> ! { - println!("\nERROR: {}", msg); + eprintln!("\nERROR: {}", msg); exit(code) } pub fn issue(msg: &str, code: i32) -> ! { - println!("\n{}", msg); + eprintln!("\n{}", msg); exit(code) }