From 18568b4a960b01a9a7fa36cd793f46991dbbca98 Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Fri, 5 Jul 2024 15:37:55 +0200 Subject: [PATCH] feat: only output error message if LLM returns no actionable command The script now checks immediately if the returned command matches the designated failure message before proceeding with further actions like explanation or option printing. This modification ensures that if the input prompt is unclear, the script directly outputs a clear error message and exits without executing additional unnecessary steps, aligning better with user expectations and reducing confusion. This change improves user experience by providing immediate feedback on input validity and makes the script's flow more logical and efficient. Resolves #52 Signed-off-by: Cornelius Roemer --- please.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/please.sh b/please.sh index d4c3639..fdbc2ae 100755 --- a/please.sh +++ b/please.sh @@ -469,16 +469,16 @@ function main() { check_key get_command + + if test "${command}" = "${fail_msg}"; then + exit 1 + fi if [ "${explain}" -eq 1 ]; then explain_command fi print_option - if test "${command}" = "${fail_msg}"; then - exit 1 - fi - init_questions choose_action act_on_action