From 266fac1339bf5af9755c9bf4ed0f11a73dd3deb4 Mon Sep 17 00:00:00 2001 From: pepa65 Date: Wed, 30 Oct 2024 19:24:38 +0700 Subject: [PATCH] Update ui.rs Do not break on yes/y/YES/Y/"", break on no/n/NO/N, and keep asking otherwise Signed-off-by: pepa65 --- crates/bin/src/ui.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index b2912b9d..5c3474eb 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -34,8 +34,11 @@ pub async fn confirm() -> Result<(), BinstallError> { } match input.as_str().trim() { - "yes" | "y" | "YES" | "Y" => break true, - _ => => break false, + "" | "yes" | "y" | "YES" | "Y" => break false, + "no" | "n" | "NO" | "N" => break true, + _ => { + input.clear(); + continue; } } };