fix(example): args parser

This commit is contained in:
DarkCat09 2024-08-05 16:09:59 +04:00
parent 1d6e22238c
commit fa7626b78a
Signed by: DarkCat09
GPG key ID: 0A26CD5B3345D6E3

View file

@ -9,10 +9,11 @@ async fn main() -> Result<(), tokio_gemini::LibError> {
let mut args = std::env::args(); let mut args = std::env::args();
let mut insecure = false; let mut insecure = false;
let mut url = "gemini://geminiprotocol.net/".to_owned(); let mut url = "gemini://geminiprotocol.net/".to_owned();
if let Some(arg) = args.nth(1) { _ = args.next(); // skip exe path
if let Some(arg) = args.next() {
if arg == "-k" { if arg == "-k" {
insecure = true; insecure = true;
if let Some(arg) = args.nth(2) { if let Some(arg) = args.next() {
url = arg; url = arg;
} }
} else { } else {