based on map-tool
This commit is contained in:
parent
6d303334c9
commit
052dc565e9
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/target
|
1547
Cargo.lock
generated
Normal file
1547
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
16
Cargo.toml
Normal file
16
Cargo.toml
Normal file
@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "asset-tool"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.75"
|
||||
clap = { version = "4.4.2", features = ["derive"] }
|
||||
lazy-regex = "3.1.0"
|
||||
rbx_binary = "0.7.1"
|
||||
rbx_dom_weak = "2.5.0"
|
||||
rbx_reflection_database = "0.2.7"
|
||||
rbx_xml = "0.13.1"
|
||||
reqwest = "0.11.23"
|
45
src/main.rs
Normal file
45
src/main.rs
Normal file
@ -0,0 +1,45 @@
|
||||
use std::io::{Read,Seek};
|
||||
use clap::{Args,Parser,Subcommand};
|
||||
use anyhow::Result as AResult;
|
||||
|
||||
type AssetID=u64;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(author,version,about,long_about=None)]
|
||||
#[command(propagate_version = true)]
|
||||
struct Cli{
|
||||
#[command(subcommand)]
|
||||
command:Commands,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum Commands{
|
||||
Download(AssetIDList),
|
||||
Upload{path:std::path::PathBuf,asset_id:AssetID},
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
struct PathBufList{
|
||||
paths:Vec<std::path::PathBuf>
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
struct AssetIDList{
|
||||
asset_ids:Vec<AssetID>,
|
||||
}
|
||||
|
||||
fn main()->AResult<()>{
|
||||
let cli=Cli::parse();
|
||||
match cli.command{
|
||||
Commands::Download(asset_id_list)=>download_list(asset_id_list.asset_ids).await,
|
||||
Commands::Upload{path,asset_id}=>upload_file(path,asset_id),
|
||||
}
|
||||
}
|
||||
|
||||
fn upload_file(_path:std::path::PathBuf,_asset_id:AssetID)->AResult<()>{
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn download_list(_asset_ids:Vec<AssetID>)->AResult<()>{
|
||||
Ok(())
|
||||
}
|
Loading…
Reference in New Issue
Block a user