Print errors to stderr instead of stdout

This commit is contained in:
Kiana Sheibani 2024-01-30 14:26:02 -05:00
parent 3368457096
commit e05f117def
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
2 changed files with 8 additions and 3 deletions

View file

@ -144,7 +144,12 @@ fn main() {
sync(&connection, get_auth_token(&config_dir), datasets, all) 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."),
} }
} }

View file

@ -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 const SECS_IN_WEEK: u64 = SECS_IN_DAY * 7;
pub fn error(msg: &str, code: i32) -> ! { pub fn error(msg: &str, code: i32) -> ! {
println!("\nERROR: {}", msg); eprintln!("\nERROR: {}", msg);
exit(code) exit(code)
} }
pub fn issue(msg: &str, code: i32) -> ! { pub fn issue(msg: &str, code: i32) -> ! {
println!("\n{}", msg); eprintln!("\n{}", msg);
exit(code) exit(code)
} }