From cbe274b7d652e1f31bb373c8eeb41472e183f880 Mon Sep 17 00:00:00 2001 From: cschantz Date: Wed, 17 Dec 2025 00:58:07 -0500 Subject: [PATCH] Improve CHECK 32 menu detection accuracy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issues Fixed: 1. Pattern too strict - only accepted "Back to Main Menu|Exit" Now accepts any "Back" or "Exit" text (e.g., "Back to Backup Menu") 2. False positives on handle_*_menu() functions These are event handlers, not menu display functions Now only checks show_*_menu() functions Changes: - Relaxed pattern: (Back to Main Menu|Exit) → (Back|Exit) - Removed handle_.*_menu() from detection (handlers don't display menus) - Updated grep to only find show_.*_menu() functions Result: Fewer false positives, catches real menu standard issues --- tools/toolkit-qa-check.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/toolkit-qa-check.sh b/tools/toolkit-qa-check.sh index 3b9e05e..44c3219 100755 --- a/tools/toolkit-qa-check.sh +++ b/tools/toolkit-qa-check.sh @@ -966,15 +966,15 @@ echo "" # Check for menus with inconsistent back buttons while IFS=: read -r file line_num line_content; do - # Look for menu functions (show_*_menu) - if echo "$line_content" | grep -qE 'show_.*_menu\(\)|handle_.*_menu\(\)'; then + # Look for menu display functions (show_*_menu only, not handle_*_menu handlers) + if echo "$line_content" | grep -qE 'show_.*_menu\(\)'; then menu_file="$file" # Check if this file has proper back button (within next 100 lines) has_back=0 line_count=0 while IFS= read -r check_line && [ "$line_count" -lt 100 ]; do - if echo "$check_line" | grep -qE '\$\{RED\}0\)\$\{NC\}.*(Back to Main Menu|Exit)'; then + if echo "$check_line" | grep -qE '\$\{RED\}0\)\$\{NC\}.*(Back|Exit)'; then has_back=1 break fi @@ -986,7 +986,7 @@ while IFS=: read -r file line_num line_content; do count_issue "LOW" fi fi -done < <(grep -rn 'show_.*_menu()\|handle_.*_menu()' "$TOOLKIT_PATH" --include="*.sh" 2>/dev/null) +done < <(grep -rn 'show_.*_menu()' "$TOOLKIT_PATH" --include="*.sh" 2>/dev/null) # Check for inconsistent separators in menus while IFS=: read -r file line_num line_content; do