This commit is contained in:
Quaternions 2023-12-30 17:43:22 -08:00
parent 0a41d25270
commit d71d583d8f

@ -1,45 +1,45 @@
use std::io::{Read, Seek};
use clap::{Args, Parser, Subcommand};
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(author,version,about,long_about=None)]
#[command(propagate_version = true)]
struct Cli {
struct Cli{
#[command(subcommand)]
command: Commands,
command:Commands,
}
#[derive(Subcommand)]
enum Commands {
enum Commands{
Download(AssetIDList),
Upload{path:std::path::PathBuf,assetid:u64},
Upload{path:std::path::PathBuf,asset_id:u64},
}
#[derive(Args)]
struct PathBufList {
struct PathBufList{
paths:Vec<std::path::PathBuf>
}
#[derive(Args)]
struct AssetIDList {
assetids: Vec<AssetID>,
struct AssetIDList{
asset_ids:Vec<AssetID>,
}
fn main() -> AResult<()> {
let cli = Cli::parse();
match cli.command {
Commands::Download(assetid_list)=>download_list(assetid_list.assetids),
Commands::Upload{path,assetid}=>upload_file(path,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,assetid:u64)->AResult<()>{
fn upload_file(path:std::path::PathBuf,asset_id:u64)->AResult<()>{
Ok(())
}
fn download_list(assetids:Vec<AssetID>)->AResult<()>{
async fn download_list(asset_ids:Vec<AssetID>)->AResult<()>{
Ok(())
}