From 8d31ef456e33353f73f30bec96f7dccc6dbb23a6 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Mon, 18 Jul 2022 15:49:26 +0100 Subject: [PATCH] fixed argument bug --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 51bce86..1a90986 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,13 +31,19 @@ fn main() { anime = true; //look at the next argument and see if it is a search term if let Some(arg) = std::env::args().nth(count + 1) { - search = arg; + if !arg.starts_with("-") { + search = arg; + } } + } if arg == "--ln" || arg == "-l" { ln = true; + //if let Some(arg) = std::env::args().nth(count + 1) and that arg does not start with a '-' set search to that arg if let Some(arg) = std::env::args().nth(count + 1) { - search = arg; + if !arg.starts_with("-") { + search = arg; + } } } if arg == "--chapter" || arg == "-c" {