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{