mirror of
https://github.com/acedanger/shell.git
synced 2026-03-24 19:11:48 -07:00
feat: Improve help command formatting for better readability
This commit is contained in:
@@ -534,26 +534,28 @@ check_all_databases() {
|
||||
|
||||
# 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 -e "${BOLD}${WHITE}Commands:${RESET}"
|
||||
echo -e " ${GREEN}${BOLD}check${RESET} Read-only database integrity check"
|
||||
echo -e " ${YELLOW}${BOLD}repair${RESET} Interactive database repair"
|
||||
echo -e " ${YELLOW}${BOLD}repair --gentle${RESET} Gentle repair methods only"
|
||||
echo -e " ${RED}${BOLD}repair --force${RESET} Aggressive repair methods"
|
||||
echo -e " ${RED}${BOLD}nuclear${RESET} Nuclear recovery (replace from backup)"
|
||||
echo -e " ${CYAN}${BOLD}backups${RESET} List and manage database backup files"
|
||||
echo -e " ${GREEN}${BOLD}install-dbrepair${RESET} Install or update DBRepair tool"
|
||||
echo -e " ${CYAN}${BOLD}help${RESET} Show this help message"
|
||||
printf " ${GREEN}${BOLD}%-18s${RESET} %s\n" "check" "Read-only database integrity check"
|
||||
printf " ${YELLOW}${BOLD}%-18s${RESET} %s\n" "repair" "Interactive database repair"
|
||||
printf " ${YELLOW}${BOLD}%-18s${RESET} %s\n" "repair --gentle" "Gentle repair methods only"
|
||||
printf " ${RED}${BOLD}%-18s${RESET} %s\n" "repair --force" "Aggressive repair methods"
|
||||
printf " ${RED}${BOLD}%-18s${RESET} %s\n" "nuclear" "Nuclear recovery (replace from backup)"
|
||||
printf " ${CYAN}${BOLD}%-18s${RESET} %s\n" "backups" "List and manage database backup files"
|
||||
printf " ${GREEN}${BOLD}%-18s${RESET} %s\n" "install-dbrepair" "Install or update DBRepair tool"
|
||||
printf " ${CYAN}${BOLD}%-18s${RESET} %s\n" "help" "Show this help message"
|
||||
echo ""
|
||||
echo -e "${BOLD}${WHITE}Examples:${RESET}"
|
||||
echo -e " ${DIM}$(basename "$0") check # Safe integrity check${RESET}"
|
||||
echo -e " ${DIM}$(basename "$0") repair # Interactive repair${RESET}"
|
||||
echo -e " ${DIM}$(basename "$0") repair --gentle # Minimal repair only${RESET}"
|
||||
echo -e " ${DIM}$(basename "$0") backups # List DB backups${RESET}"
|
||||
echo -e " ${DIM}$(basename "$0") backups delete # Interactive backup deletion${RESET}"
|
||||
echo -e " ${DIM}$(basename "$0") backups delete --name foo # Delete by name pattern${RESET}"
|
||||
echo -e " ${DIM}$(basename "$0") install-dbrepair # Install/update DBRepair${RESET}"
|
||||
printf " ${DIM}%-46s # %s${RESET}\n" "${script} check" "Safe integrity check"
|
||||
printf " ${DIM}%-46s # %s${RESET}\n" "${script} repair" "Interactive repair"
|
||||
printf " ${DIM}%-46s # %s${RESET}\n" "${script} repair --gentle" "Minimal repair only"
|
||||
printf " ${DIM}%-46s # %s${RESET}\n" "${script} backups" "List DB backups"
|
||||
printf " ${DIM}%-46s # %s${RESET}\n" "${script} backups delete" "Interactive backup deletion"
|
||||
printf " ${DIM}%-46s # %s${RESET}\n" "${script} backups delete --name foo" "Delete by name pattern"
|
||||
printf " ${DIM}%-46s # %s${RESET}\n" "${script} install-dbrepair" "Install/update DBRepair"
|
||||
echo ""
|
||||
echo -e "${BOLD}${YELLOW}⚠️ WARNING:${RESET} Always run ${CYAN}check${RESET} first before attempting repairs!"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user