add verbose

This commit is contained in:
Mylloon 2022-09-03 14:16:11 +02:00
parent 93ff79d96a
commit d0c904181c
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 7 additions and 4 deletions

View file

@ -1,7 +1,7 @@
/// Download all the posts
pub async fn download_posts(
posts: (String, Vec<String>),
dir: String,
dir: &String,
download_special_files: bool,
) {
// Create folder, silently ignore if already exists
@ -9,7 +9,7 @@ pub async fn download_posts(
// Download all the posts
for post in posts.1 {
download(&posts.0, &dir, post, "md").await;
download(&posts.0, dir, post, "md").await;
}
// Check if specials files need to be downloaded
@ -20,7 +20,7 @@ pub async fn download_posts(
];
for file in special_files {
download(&posts.0, &dir, file.0, file.1).await;
download(&posts.0, dir, file.0, file.1).await;
}
}
}

View file

@ -37,6 +37,7 @@ async fn main() {
let cli = Cli::parse();
// Retrieve user's posts
println!("Retrieving posts...");
let posts = parse::get_posts(
cli.scheme.to_lowercase(),
cli.username.to_lowercase(),
@ -51,5 +52,7 @@ async fn main() {
};
// Download the posts
download::download_posts(posts, directory, cli.special_files).await;
println!("Downloads posts...");
download::download_posts(posts, &directory, cli.special_files).await;
println!("Download completed in {}/ folder.", directory);
}