This commit is contained in:
Waradu 2024-10-19 22:28:13 +02:00
commit 27ac40966f
No known key found for this signature in database
GPG key ID: F85AAC8BA8B8DAAD
6 changed files with 1809 additions and 0 deletions

30
src/main.rs Normal file
View file

@ -0,0 +1,30 @@
use clap::Parser;
use streamshare::upload;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Args {
file: Option<String>,
}
#[tokio::main]
async fn main() {
let args = Args::parse();
if let Some(file_path) = args.file {
match upload(&file_path).await {
Ok((file_identifier, _deletion_token)) => {
let download_url = format!(
"https://streamshare.wireway.ch/download/{}",
file_identifier
);
println!("File uploaded successfully");
println!("Download URL: {}", download_url);
}
Err(e) => eprintln!("Error: {}", e),
}
} else {
eprintln!("Please provide a file path");
}
}