From 8e589f7f0f9ba7c66b805f3ad62fd56fb4424f6a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 16 Jan 2024 21:50:35 -0800 Subject: [PATCH] download asset list --- src/main.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index c3a8ee0..3680e80 100644 --- a/src/main.rs +++ b/src/main.rs @@ -63,7 +63,7 @@ struct Cli{ #[derive(Subcommand)] enum Commands{ DownloadHistory, - Download, + Download(AssetIDList), Upload, Compile, Decompile, @@ -78,6 +78,11 @@ enum DecompileStyle{ RoxRojo, } +#[derive(Args)] +struct AssetIDList{ + asset_ids:Vec +} + #[derive(Args)] struct PathBufList{ paths:Vec @@ -149,7 +154,14 @@ async fn main()->AResult<()>{ cookie:cookie.unwrap(), asset_id:cli.asset_id.unwrap(), }).await, - Commands::Download=>download_list(cookie.unwrap(),vec![(cli.asset_id.unwrap(),cli.output.unwrap())]).await, + Commands::Download(asset_id_list)=>download_list( + cookie.unwrap(), + asset_id_list.asset_ids.into_iter().map(|asset_id|{ + let mut path=cli.output.clone().unwrap(); + path.push(asset_id.to_string()); + (asset_id,path) + }).collect() + ).await, Commands::Upload=>upload_list(cookie.unwrap(),cli.group,vec![(cli.asset_id.unwrap(),cli.output.unwrap())]).await, Commands::Compile=>compile(cli.input.unwrap(),cli.output.unwrap()), Commands::Decompile=>decompile(DecompileConfig{