download asset list
This commit is contained in:
parent
cbb5805d54
commit
8e589f7f0f
16
src/main.rs
16
src/main.rs
@ -63,7 +63,7 @@ struct Cli{
|
|||||||
#[derive(Subcommand)]
|
#[derive(Subcommand)]
|
||||||
enum Commands{
|
enum Commands{
|
||||||
DownloadHistory,
|
DownloadHistory,
|
||||||
Download,
|
Download(AssetIDList),
|
||||||
Upload,
|
Upload,
|
||||||
Compile,
|
Compile,
|
||||||
Decompile,
|
Decompile,
|
||||||
@ -78,6 +78,11 @@ enum DecompileStyle{
|
|||||||
RoxRojo,
|
RoxRojo,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Args)]
|
||||||
|
struct AssetIDList{
|
||||||
|
asset_ids:Vec<AssetID>
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Args)]
|
#[derive(Args)]
|
||||||
struct PathBufList{
|
struct PathBufList{
|
||||||
paths:Vec<std::path::PathBuf>
|
paths:Vec<std::path::PathBuf>
|
||||||
@ -149,7 +154,14 @@ async fn main()->AResult<()>{
|
|||||||
cookie:cookie.unwrap(),
|
cookie:cookie.unwrap(),
|
||||||
asset_id:cli.asset_id.unwrap(),
|
asset_id:cli.asset_id.unwrap(),
|
||||||
}).await,
|
}).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::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::Compile=>compile(cli.input.unwrap(),cli.output.unwrap()),
|
||||||
Commands::Decompile=>decompile(DecompileConfig{
|
Commands::Decompile=>decompile(DecompileConfig{
|
||||||
|
Loading…
Reference in New Issue
Block a user