1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-09 22:34:16 +00:00

feat: add configurable purge paths (#197)

This commit is contained in:
Andrii Medvediev
2025-12-29 12:16:16 +01:00
committed by GitHub
parent 657d7e767c
commit 7e62ed19f9
4 changed files with 202 additions and 2 deletions

View File

@@ -111,6 +111,26 @@ perform_purge() {
printf '\n'
}
# Show help message
show_help() {
echo -e "${PURPLE_BOLD}Mole Purge${NC} - Clean old project build artifacts"
echo ""
echo -e "${YELLOW}Usage:${NC} mo purge [options]"
echo ""
echo -e "${YELLOW}Options:${NC}"
echo " --help Show this help message"
echo " --debug Enable debug logging"
echo ""
echo -e "${YELLOW}Configuration:${NC}"
echo " To customize search paths, create: ${NC}$HOME/.config/mole/purge_paths${NC}"
echo " Add one directory path per line (supports ~)."
echo ""
echo -e "${YELLOW}Default Paths:${NC}"
for path in "${DEFAULT_PURGE_SEARCH_PATHS[@]}"; do
echo " - $path"
done
}
# Main entry point
main() {
# Set up signal handling
@@ -119,12 +139,16 @@ main() {
# Parse arguments
for arg in "$@"; do
case "$arg" in
"--help")
show_help
exit 0
;;
"--debug")
export MO_DEBUG=1
;;
*)
echo "Unknown option: $arg"
echo "Use 'mo --help' for usage information"
echo "Use 'mo purge --help' for usage information"
exit 1
;;
esac