Print extra new line on the correct output
This commit is contained in:
parent
c5b61bac25
commit
cf9adfd203
|
@ -421,7 +421,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "nhentairs"
|
||||
version = "0.4.0"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"reqwest",
|
||||
"serde",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "nhentairs"
|
||||
version = "0.4.0"
|
||||
version = "0.5.0"
|
||||
authors = ["blank X <theblankx@protonmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
|
|
|
@ -9,8 +9,7 @@ extern crate reqwest;
|
|||
|
||||
pub async fn run(args: env::Args) {
|
||||
let sauces = utils::get_arg_sauces(args).unwrap();
|
||||
let mut remaining_to_show = sauces.len();
|
||||
if remaining_to_show < 1 {
|
||||
if sauces.len() < 1 {
|
||||
eprintln!("Missing sauce(s)");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -23,19 +22,25 @@ pub async fn run(args: env::Args) {
|
|||
}));
|
||||
}
|
||||
let mut fail = false;
|
||||
let mut one_done = false;
|
||||
for handle in handles {
|
||||
let (sauce_info, sauce) = handle.await.unwrap();
|
||||
match sauce_info {
|
||||
structs::GalleryInfo::Info(sauce_info) => println!("{}", utils::human_sauce_info(&sauce_info)),
|
||||
structs::GalleryInfo::Info(sauce_info) => {
|
||||
if one_done {
|
||||
println!("");
|
||||
}
|
||||
println!("{}", utils::human_sauce_info(&sauce_info));
|
||||
},
|
||||
structs::GalleryInfo::Error(sauce_error) => {
|
||||
if one_done {
|
||||
eprintln!("");
|
||||
}
|
||||
eprintln!("Sauce: {}\nError: {}", sauce, sauce_error.error);
|
||||
fail = true;
|
||||
}
|
||||
};
|
||||
if remaining_to_show > 1 {
|
||||
println!("");
|
||||
remaining_to_show -= 1;
|
||||
}
|
||||
one_done = true;
|
||||
}
|
||||
if fail {
|
||||
exit(1);
|
||||
|
|
Loading…
Reference in New Issue