mirror of
https://github.com/mrfluffy-dev/kami.git
synced 2026-01-17 04:50:32 +00:00
fixed argument bug
This commit is contained in:
@@ -31,15 +31,21 @@ fn main() {
|
|||||||
anime = true;
|
anime = true;
|
||||||
//look at the next argument and see if it is a search term
|
//look at the next argument and see if it is a search term
|
||||||
if let Some(arg) = std::env::args().nth(count + 1) {
|
if let Some(arg) = std::env::args().nth(count + 1) {
|
||||||
|
if !arg.starts_with("-") {
|
||||||
search = arg;
|
search = arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if arg == "--ln" || arg == "-l" {
|
if arg == "--ln" || arg == "-l" {
|
||||||
ln = true;
|
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) {
|
if let Some(arg) = std::env::args().nth(count + 1) {
|
||||||
|
if !arg.starts_with("-") {
|
||||||
search = arg;
|
search = arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if arg == "--chapter" || arg == "-c" {
|
if arg == "--chapter" || arg == "-c" {
|
||||||
if let Some(arg) = std::env::args().nth(count + 1) {
|
if let Some(arg) = std::env::args().nth(count + 1) {
|
||||||
chapter = arg.parse::<u32>().unwrap();
|
chapter = arg.parse::<u32>().unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user