diff --git a/src/main.rs b/src/main.rs index 55db490..7661715 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,12 +14,14 @@ async fn main() -> Result<(), Option<()>> { env_logger::init(); let args: Vec = args().collect(); - if args.len() != 3 { - println!("Usage: {} ", args[0]); + if args.len() != 5 { + println!("Usage: {} ", args[0]); return Err(None); } let jid = &args[1]; let password = &args[2]; + let service = &args[3]; + let file = Path::new(&args[4]); // Client instance let mut client = ClientBuilder::new(jid, password) @@ -35,8 +37,8 @@ async fn main() -> Result<(), Option<()>> { Event::Online => { println!("Online."); client.upload_file_with( - "share.serv.ice" - Path::new("/some/file/path"), + service, + file, ).await; } Event::HTTPUploadedFile(url) => {