feat: Improve help command formatting for better readability

This commit is contained in:
Peter Wood
2026-03-07 11:01:20 -05:00
parent 8e7e22a1a3
commit edae8513d1

View File

@@ -534,26 +534,28 @@ check_all_databases() {
# Show help # Show help
show_help() { show_help() {
echo -e "${BOLD}${WHITE}Usage:${RESET} ${CYAN}$(basename "$0")${RESET} ${YELLOW}<command>${RESET} ${DIM}[options]${RESET}" local script
script=$(basename "$0")
echo -e "${BOLD}${WHITE}Usage:${RESET} ${CYAN}${script}${RESET} ${YELLOW}<command>${RESET} ${DIM}[options]${RESET}"
echo "" echo ""
echo -e "${BOLD}${WHITE}Commands:${RESET}" echo -e "${BOLD}${WHITE}Commands:${RESET}"
echo -e " ${GREEN}${BOLD}check${RESET} Read-only database integrity check" printf " ${GREEN}${BOLD}%-18s${RESET} %s\n" "check" "Read-only database integrity check"
echo -e " ${YELLOW}${BOLD}repair${RESET} Interactive database repair" printf " ${YELLOW}${BOLD}%-18s${RESET} %s\n" "repair" "Interactive database repair"
echo -e " ${YELLOW}${BOLD}repair --gentle${RESET} Gentle repair methods only" printf " ${YELLOW}${BOLD}%-18s${RESET} %s\n" "repair --gentle" "Gentle repair methods only"
echo -e " ${RED}${BOLD}repair --force${RESET} Aggressive repair methods" printf " ${RED}${BOLD}%-18s${RESET} %s\n" "repair --force" "Aggressive repair methods"
echo -e " ${RED}${BOLD}nuclear${RESET} Nuclear recovery (replace from backup)" printf " ${RED}${BOLD}%-18s${RESET} %s\n" "nuclear" "Nuclear recovery (replace from backup)"
echo -e " ${CYAN}${BOLD}backups${RESET} List and manage database backup files" printf " ${CYAN}${BOLD}%-18s${RESET} %s\n" "backups" "List and manage database backup files"
echo -e " ${GREEN}${BOLD}install-dbrepair${RESET} Install or update DBRepair tool" printf " ${GREEN}${BOLD}%-18s${RESET} %s\n" "install-dbrepair" "Install or update DBRepair tool"
echo -e " ${CYAN}${BOLD}help${RESET} Show this help message" printf " ${CYAN}${BOLD}%-18s${RESET} %s\n" "help" "Show this help message"
echo "" echo ""
echo -e "${BOLD}${WHITE}Examples:${RESET}" echo -e "${BOLD}${WHITE}Examples:${RESET}"
echo -e " ${DIM}$(basename "$0") check # Safe integrity check${RESET}" printf " ${DIM}%-46s # %s${RESET}\n" "${script} check" "Safe integrity check"
echo -e " ${DIM}$(basename "$0") repair # Interactive repair${RESET}" printf " ${DIM}%-46s # %s${RESET}\n" "${script} repair" "Interactive repair"
echo -e " ${DIM}$(basename "$0") repair --gentle # Minimal repair only${RESET}" printf " ${DIM}%-46s # %s${RESET}\n" "${script} repair --gentle" "Minimal repair only"
echo -e " ${DIM}$(basename "$0") backups # List DB backups${RESET}" printf " ${DIM}%-46s # %s${RESET}\n" "${script} backups" "List DB backups"
echo -e " ${DIM}$(basename "$0") backups delete # Interactive backup deletion${RESET}" printf " ${DIM}%-46s # %s${RESET}\n" "${script} backups delete" "Interactive backup deletion"
echo -e " ${DIM}$(basename "$0") backups delete --name foo # Delete by name pattern${RESET}" printf " ${DIM}%-46s # %s${RESET}\n" "${script} backups delete --name foo" "Delete by name pattern"
echo -e " ${DIM}$(basename "$0") install-dbrepair # Install/update DBRepair${RESET}" printf " ${DIM}%-46s # %s${RESET}\n" "${script} install-dbrepair" "Install/update DBRepair"
echo "" echo ""
echo -e "${BOLD}${YELLOW}⚠️ WARNING:${RESET} Always run ${CYAN}check${RESET} first before attempting repairs!" echo -e "${BOLD}${YELLOW}⚠️ WARNING:${RESET} Always run ${CYAN}check${RESET} first before attempting repairs!"
echo "" echo ""