From 596d69a8fa10134bb59aafd8fbfb4cede9c866f0 Mon Sep 17 00:00:00 2001 From: priestlypython Date: Mon, 27 Oct 2025 21:19:25 -0700 Subject: [PATCH] fix: Correct ANSI color rendering in help display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- bash-helper.sh | 106 ++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/bash-helper.sh b/bash-helper.sh index 6eb6793..a231910 100755 --- a/bash-helper.sh +++ b/bash-helper.sh @@ -32,60 +32,58 @@ EOF show_help() { show_banner - cat << EOF -${BOLD}${YELLOW}QUICK START${NC} - ${GREEN}bash-helper ask "find large files"${NC} # Ask a question - ${GREEN}bash-helper category files${NC} # Browse by category - ${GREEN}bash-helper explain "tar -czf"${NC} # Explain a command - -${BOLD}${YELLOW}MODES${NC} - ${CYAN}Natural Language Queries:${NC} - ${GREEN}ask${NC} "query" Ask in natural language - ${GREEN}task${NC} "description" Describe what you want to do - - ${CYAN}Browse & Explore:${NC} - ${GREEN}category${NC} NAME Browse by category (files/text/network/system) - ${GREEN}explain${NC} "command" Explain what a command does - - ${CYAN}Direct Lookup:${NC} - ${GREEN}COMMAND [FILTER]${NC} Show flags for command (e.g., ls size) - ${GREEN}-i${NC}, ${GREEN}--interactive${NC} Interactive fzf mode - ${GREEN}-l${NC}, ${GREEN}--list${NC} List all commands - -${BOLD}${YELLOW}CATEGORIES${NC} (20+ tasks) - ${CYAN}files${NC} File operations (compress, find, permissions, symlinks) - ${CYAN}text${NC} Text processing (search, replace, compare, count) - ${CYAN}network${NC} Network ops (download, ports, ping) - ${CYAN}system${NC} System monitoring (cpu, memory, processes) - -${BOLD}${YELLOW}EXAMPLES${NC} - ${DIM}# Natural language${NC} - bash-helper ask "compress folder" - bash-helper ask "search text in files" - bash-helper task "monitor cpu usage" - - ${DIM}# Browse and learn${NC} - bash-helper category network - bash-helper explain "find . -name '*.txt'" - - ${DIM}# Original modes (still work)${NC} - bash-helper ls size # Direct flag lookup - bash-helper # Interactive fzf mode - -${BOLD}${YELLOW}REQUIREMENTS${NC} - ${GREEN}✓${NC} jq (for natural language queries) - ${GREEN}✓${NC} fzf (for interactive mode only) - -${BOLD}${YELLOW}AI ENHANCEMENT${NC} - For advanced natural language understanding, install Ollama: - ${DIM}curl -fsSL https://ollama.com/install.sh | sh${NC} - ${DIM}ollama pull codellama:7b${NC} - Then use: ${GREEN}bash-helper ai "complex query"${NC} ${DIM}(Phase 3 - coming soon)${NC} - -${YELLOW}Database:${NC} $DB_FILE -${YELLOW}Version:${NC} 2.0.0 (Phase 1 Complete) - -EOF + echo -e "${BOLD}${YELLOW}QUICK START${NC}" + echo -e " ${GREEN}bash-helper ask \"find large files\"${NC} # Ask a question" + echo -e " ${GREEN}bash-helper category files${NC} # Browse by category" + echo -e " ${GREEN}bash-helper explain \"tar -czf\"${NC} # Explain a command" + echo "" + echo -e "${BOLD}${YELLOW}MODES${NC}" + echo -e " ${CYAN}Natural Language Queries:${NC}" + echo -e " ${GREEN}ask${NC} \"query\" Ask in natural language" + echo -e " ${GREEN}task${NC} \"description\" Describe what you want to do" + echo "" + echo -e " ${CYAN}Browse & Explore:${NC}" + echo -e " ${GREEN}category${NC} NAME Browse by category (files/text/network/system)" + echo -e " ${GREEN}explain${NC} \"command\" Explain what a command does" + echo "" + echo -e " ${CYAN}Direct Lookup:${NC}" + echo -e " ${GREEN}COMMAND [FILTER]${NC} Show flags for command (e.g., ls size)" + echo -e " ${GREEN}-i${NC}, ${GREEN}--interactive${NC} Interactive fzf mode" + echo -e " ${GREEN}-l${NC}, ${GREEN}--list${NC} List all commands" + echo "" + echo -e "${BOLD}${YELLOW}CATEGORIES${NC} (20+ tasks)" + echo -e " ${CYAN}files${NC} File operations (compress, find, permissions, symlinks)" + echo -e " ${CYAN}text${NC} Text processing (search, replace, compare, count)" + echo -e " ${CYAN}network${NC} Network ops (download, ports, ping)" + echo -e " ${CYAN}system${NC} System monitoring (cpu, memory, processes)" + echo "" + echo -e "${BOLD}${YELLOW}EXAMPLES${NC}" + echo -e " ${DIM}# Natural language${NC}" + echo " bash-helper ask \"compress folder\"" + echo " bash-helper ask \"search text in files\"" + echo " bash-helper task \"monitor cpu usage\"" + echo "" + echo -e " ${DIM}# Browse and learn${NC}" + echo " bash-helper category network" + echo " bash-helper explain \"find . -name '*.txt'\"" + echo "" + echo -e " ${DIM}# Original modes (still work)${NC}" + echo " bash-helper ls size # Direct flag lookup" + echo " bash-helper # Interactive fzf mode" + echo "" + echo -e "${BOLD}${YELLOW}REQUIREMENTS${NC}" + echo -e " ${GREEN}✓${NC} jq (for natural language queries)" + echo -e " ${GREEN}✓${NC} fzf (for interactive mode only)" + echo "" + echo -e "${BOLD}${YELLOW}AI ENHANCEMENT${NC}" + echo " For advanced natural language understanding, install Ollama:" + echo -e " ${DIM}curl -fsSL https://ollama.com/install.sh | sh${NC}" + echo -e " ${DIM}ollama pull codellama:7b${NC}" + echo -e " Then use: ${GREEN}bash-helper ai \"complex query\"${NC} ${DIM}(Phase 3 - coming soon)${NC}" + echo "" + echo -e "${YELLOW}Database:${NC} $DB_FILE" + echo -e "${YELLOW}Version:${NC} 2.0.0 (Phase 1 Complete)" + echo "" } # Check if jq is available