Improve CHECK 32 menu detection accuracy
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user