add verbose
This commit is contained in:
parent
93ff79d96a
commit
d0c904181c
2 changed files with 7 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
/// Download all the posts
|
/// Download all the posts
|
||||||
pub async fn download_posts(
|
pub async fn download_posts(
|
||||||
posts: (String, Vec<String>),
|
posts: (String, Vec<String>),
|
||||||
dir: String,
|
dir: &String,
|
||||||
download_special_files: bool,
|
download_special_files: bool,
|
||||||
) {
|
) {
|
||||||
// Create folder, silently ignore if already exists
|
// Create folder, silently ignore if already exists
|
||||||
|
@ -9,7 +9,7 @@ pub async fn download_posts(
|
||||||
|
|
||||||
// Download all the posts
|
// Download all the posts
|
||||||
for post in posts.1 {
|
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
|
// Check if specials files need to be downloaded
|
||||||
|
@ -20,7 +20,7 @@ pub async fn download_posts(
|
||||||
];
|
];
|
||||||
|
|
||||||
for file in special_files {
|
for file in special_files {
|
||||||
download(&posts.0, &dir, file.0, file.1).await;
|
download(&posts.0, dir, file.0, file.1).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ async fn main() {
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
||||||
// Retrieve user's posts
|
// Retrieve user's posts
|
||||||
|
println!("Retrieving posts...");
|
||||||
let posts = parse::get_posts(
|
let posts = parse::get_posts(
|
||||||
cli.scheme.to_lowercase(),
|
cli.scheme.to_lowercase(),
|
||||||
cli.username.to_lowercase(),
|
cli.username.to_lowercase(),
|
||||||
|
@ -51,5 +52,7 @@ async fn main() {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Download the posts
|
// 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);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue