From e564be08f592b15694427b328416bae4c1e776c7 Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 20 May 2023 23:08:16 +0200 Subject: [PATCH] Search query length now at least 4 characters --- Tranga-CLI/Tranga_Cli.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tranga-CLI/Tranga_Cli.cs b/Tranga-CLI/Tranga_Cli.cs index 8c2578c..cddbca6 100644 --- a/Tranga-CLI/Tranga_Cli.cs +++ b/Tranga-CLI/Tranga_Cli.cs @@ -414,8 +414,10 @@ public static class Tranga_Cli private static void SearchTasks(TaskManager taskManager, Logger logger) { logger.WriteLine("Tranga_CLI", "Menu: Search task"); + Console.Clear(); + Console.WriteLine("Enter search query:"); string? query = Console.ReadLine(); - while (query is null || query.Length < 1) + while (query is null || query.Length < 4) query = Console.ReadLine(); PrintTasks(taskManager.GetAllTasks().Where(qTask => qTask.ToString().ToLower().Contains(query, StringComparison.OrdinalIgnoreCase)).ToArray(), logger);