Improve name matching

This commit is contained in:
axtlos 2024-04-19 23:26:20 +02:00
parent b5d8342696
commit e73783b1ba
No known key found for this signature in database
GPG Key ID: DD6D66939396C90E

View File

@ -29,7 +29,8 @@ fn main() {
}; };
for file in files { for file in files {
let desktop_file = format!("{}", file.as_ref().unwrap().file_name().into_string().unwrap()); let desktop_file = format!("{}", file.as_ref().unwrap().file_name().into_string().unwrap());
if desktop_file.contains(&cli.search) { let mut name = desktop_file.split(".");
if name.find(|x| *x == cli.search).is_some() {
let path = file.as_ref().unwrap().path(); let path = file.as_ref().unwrap().path();
let out = if cli.show_tilde { let out = if cli.show_tilde {
format!("{}", path.display().to_string().replace(&home, "~")) format!("{}", path.display().to_string().replace(&home, "~"))