fix: Correct ANSI color rendering in help display

Changed show_help() from heredoc to echo -e statements to properly
render color escape codes. Help menu now displays with proper colors
instead of literal escape sequences.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-27 21:19:25 -07:00
parent bc3197ad8f
commit 596d69a8fa
+52 -54
View File
@@ -32,60 +32,58 @@ EOF
show_help() { show_help() {
show_banner show_banner
cat << EOF echo -e "${BOLD}${YELLOW}QUICK START${NC}"
${BOLD}${YELLOW}QUICK START${NC} echo -e " ${GREEN}bash-helper ask \"find large files\"${NC} # Ask a question"
${GREEN}bash-helper ask "find large files"${NC} # Ask a question echo -e " ${GREEN}bash-helper category files${NC} # Browse by category"
${GREEN}bash-helper category files${NC} # Browse by category echo -e " ${GREEN}bash-helper explain \"tar -czf\"${NC} # Explain a command"
${GREEN}bash-helper explain "tar -czf"${NC} # Explain a command echo ""
echo -e "${BOLD}${YELLOW}MODES${NC}"
${BOLD}${YELLOW}MODES${NC} echo -e " ${CYAN}Natural Language Queries:${NC}"
${CYAN}Natural Language Queries:${NC} echo -e " ${GREEN}ask${NC} \"query\" Ask in natural language"
${GREEN}ask${NC} "query" Ask in natural language echo -e " ${GREEN}task${NC} \"description\" Describe what you want to do"
${GREEN}task${NC} "description" Describe what you want to do echo ""
echo -e " ${CYAN}Browse & Explore:${NC}"
${CYAN}Browse & Explore:${NC} echo -e " ${GREEN}category${NC} NAME Browse by category (files/text/network/system)"
${GREEN}category${NC} NAME Browse by category (files/text/network/system) echo -e " ${GREEN}explain${NC} \"command\" Explain what a command does"
${GREEN}explain${NC} "command" Explain what a command does echo ""
echo -e " ${CYAN}Direct Lookup:${NC}"
${CYAN}Direct Lookup:${NC} echo -e " ${GREEN}COMMAND [FILTER]${NC} Show flags for command (e.g., ls size)"
${GREEN}COMMAND [FILTER]${NC} Show flags for command (e.g., ls size) echo -e " ${GREEN}-i${NC}, ${GREEN}--interactive${NC} Interactive fzf mode"
${GREEN}-i${NC}, ${GREEN}--interactive${NC} Interactive fzf mode echo -e " ${GREEN}-l${NC}, ${GREEN}--list${NC} List all commands"
${GREEN}-l${NC}, ${GREEN}--list${NC} List all commands echo ""
echo -e "${BOLD}${YELLOW}CATEGORIES${NC} (20+ tasks)"
${BOLD}${YELLOW}CATEGORIES${NC} (20+ tasks) echo -e " ${CYAN}files${NC} File operations (compress, find, permissions, symlinks)"
${CYAN}files${NC} File operations (compress, find, permissions, symlinks) echo -e " ${CYAN}text${NC} Text processing (search, replace, compare, count)"
${CYAN}text${NC} Text processing (search, replace, compare, count) echo -e " ${CYAN}network${NC} Network ops (download, ports, ping)"
${CYAN}network${NC} Network ops (download, ports, ping) echo -e " ${CYAN}system${NC} System monitoring (cpu, memory, processes)"
${CYAN}system${NC} System monitoring (cpu, memory, processes) echo ""
echo -e "${BOLD}${YELLOW}EXAMPLES${NC}"
${BOLD}${YELLOW}EXAMPLES${NC} echo -e " ${DIM}# Natural language${NC}"
${DIM}# Natural language${NC} echo " bash-helper ask \"compress folder\""
bash-helper ask "compress folder" echo " bash-helper ask \"search text in files\""
bash-helper ask "search text in files" echo " bash-helper task \"monitor cpu usage\""
bash-helper task "monitor cpu usage" echo ""
echo -e " ${DIM}# Browse and learn${NC}"
${DIM}# Browse and learn${NC} echo " bash-helper category network"
bash-helper category network echo " bash-helper explain \"find . -name '*.txt'\""
bash-helper explain "find . -name '*.txt'" echo ""
echo -e " ${DIM}# Original modes (still work)${NC}"
${DIM}# Original modes (still work)${NC} echo " bash-helper ls size # Direct flag lookup"
bash-helper ls size # Direct flag lookup echo " bash-helper # Interactive fzf mode"
bash-helper # Interactive fzf mode echo ""
echo -e "${BOLD}${YELLOW}REQUIREMENTS${NC}"
${BOLD}${YELLOW}REQUIREMENTS${NC} echo -e " ${GREEN}${NC} jq (for natural language queries)"
${GREEN}✓${NC} jq (for natural language queries) echo -e " ${GREEN}${NC} fzf (for interactive mode only)"
${GREEN}✓${NC} fzf (for interactive mode only) echo ""
echo -e "${BOLD}${YELLOW}AI ENHANCEMENT${NC}"
${BOLD}${YELLOW}AI ENHANCEMENT${NC} echo " For advanced natural language understanding, install Ollama:"
For advanced natural language understanding, install Ollama: echo -e " ${DIM}curl -fsSL https://ollama.com/install.sh | sh${NC}"
${DIM}curl -fsSL https://ollama.com/install.sh | sh${NC} echo -e " ${DIM}ollama pull codellama:7b${NC}"
${DIM}ollama pull codellama:7b${NC} echo -e " Then use: ${GREEN}bash-helper ai \"complex query\"${NC} ${DIM}(Phase 3 - coming soon)${NC}"
Then use: ${GREEN}bash-helper ai "complex query"${NC} ${DIM}(Phase 3 - coming soon)${NC} echo ""
echo -e "${YELLOW}Database:${NC} $DB_FILE"
${YELLOW}Database:${NC} $DB_FILE echo -e "${YELLOW}Version:${NC} 2.0.0 (Phase 1 Complete)"
${YELLOW}Version:${NC} 2.0.0 (Phase 1 Complete) echo ""
EOF
} }
# Check if jq is available # Check if jq is available