download asset list

This commit is contained in:
Quaternions 2024-01-16 21:50:35 -08:00
parent cbb5805d54
commit 8e589f7f0f

View File

@ -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<AssetID>
}
#[derive(Args)]
struct PathBufList{
paths:Vec<std::path::PathBuf>
@ -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{