you can now see progress in the output

This commit is contained in:
Waradu 2024-10-20 10:07:37 +02:00
parent 591930bdef
commit 7a043ac160
No known key found for this signature in database
GPG key ID: F85AAC8BA8B8DAAD
3 changed files with 8 additions and 8 deletions

6
Cargo.lock generated
View file

@ -1191,9 +1191,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
[[package]] [[package]]
name = "streamshare" name = "streamshare"
version = "1.1.0" version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b858ea2a485166fdb9850afa3016d4bd1cd131fd13bab39b74c1e860cfd93a4b" checksum = "723b8059b8580d19ea0bdd3202fc8ba38c01719ee5ad2d5b70e530e8f3c5e22e"
dependencies = [ dependencies = [
"futures", "futures",
"reqwest", "reqwest",
@ -1306,7 +1306,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "to-streamshare" name = "to-streamshare"
version = "0.2.2" version = "0.3.0"
dependencies = [ dependencies = [
"clap", "clap",
"streamshare", "streamshare",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "to-streamshare" name = "to-streamshare"
version = "0.2.2" version = "0.3.0"
edition = "2021" edition = "2021"
description = "Upload to streamshare (to-ss > toss) from the terminal" description = "Upload to streamshare (to-ss > toss) from the terminal"
license = "MIT" license = "MIT"
@ -12,7 +12,7 @@ keywords = ["streamshare","file-sharing","upload"]
[dependencies] [dependencies]
clap = { version = "4.5.20", features = ["derive"] } clap = { version = "4.5.20", features = ["derive"] }
streamshare = "1" streamshare = "2"
tokio = { version = "1.40.0", features = ["full"] } tokio = { version = "1.40.0", features = ["full"] }
[[bin]] [[bin]]

View file

@ -20,8 +20,8 @@ async fn main() {
let args = Args::parse(); let args = Args::parse();
if let Some(delete_param) = args.delete { if let Some(delete_param) = args.delete {
if let Some((identifier, deltoken)) = parse_delete_param(&delete_param) { if let Some((file_identifier, deletion_token)) = parse_delete_param(&delete_param) {
match streamshare::delete(identifier, deltoken).await { match streamshare::delete(file_identifier, deletion_token).await {
Ok(_) => println!("File deleted successfully"), Ok(_) => println!("File deleted successfully"),
Err(e) => eprintln!("Error deleting file: {}", e), Err(e) => eprintln!("Error deleting file: {}", e),
} }
@ -29,7 +29,7 @@ async fn main() {
eprintln!("Invalid format for --delete. Use 'file_identifier/deletion_token' (e.g., 'abc123/def456')"); eprintln!("Invalid format for --delete. Use 'file_identifier/deletion_token' (e.g., 'abc123/def456')");
} }
} else if let Some(file_path) = args.file { } else if let Some(file_path) = args.file {
match upload(&file_path).await { match upload(&file_path, true).await {
Ok((file_identifier, deletion_token)) => { Ok((file_identifier, deletion_token)) => {
let download_url = format!( let download_url = format!(
"https://streamshare.wireway.ch/download/{}", "https://streamshare.wireway.ch/download/{}",