From 42d35b72193ce3b62a2741e6ccf1e7c420a137dd Mon Sep 17 00:00:00 2001 From: Marshall Porter Date: Tue, 22 Oct 2024 23:58:13 -0700 Subject: [PATCH] case insensitive --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/command.rs | 2 +- src/package.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ff3a100..7763d18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "ctrl" -version = "0.3.18" +version = "0.3.19" dependencies = [ "clap", "console", diff --git a/Cargo.toml b/Cargo.toml index 0d16b11..712fe95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ctrl" -version = "0.3.18" +version = "0.3.19" edition = "2021" description = "CLI tool for cross platform OS management" categories = ["command-line-interface"] diff --git a/src/command.rs b/src/command.rs index 3015216..482ac86 100644 --- a/src/command.rs +++ b/src/command.rs @@ -50,7 +50,7 @@ pub(crate) fn run_cmd_filtered(command: &String, filters: &Vec) -> Resul logcln("matches:", Category::Info); for line in String::from_utf8(output.stdout).unwrap().lines() { for filter in filters { - if line.contains(filter) { + if line.to_lowercase().contains(&filter.to_lowercase()) { logln(line); } } diff --git a/src/package.rs b/src/package.rs index 61ceb39..feae5ec 100644 --- a/src/package.rs +++ b/src/package.rs @@ -154,7 +154,7 @@ fn get_managers() -> Vec> { managers.push(Box::new(Pacman { program })); } // Android == Termux - Type::Android | Type::Debian | Type::Mint | Type::Raspbian | Type::Ubuntu => { + Type::Debian | Type::Ubuntu | Type::Mint | Type::Android => { let program = if exists_in_path("pkg") { "pkg".to_string() } else if exists_in_path("apt") {