Website/app/bin/make/help.sh

11 lines
470 B
Bash
Raw Normal View History

2024-02-19 21:23:38 +00:00
#!/bin/bash
source bin/make/colors.sh
COLOR_HELP_GROUP=${COLOR_START}${COLOR_FG}${COLOR_BLUE}${COLOR_END}
COLOR_HELP_COMMAND=${COLOR_START}${COLOR_FG}${COLOR_GREEN}${COLOR_END}
COLOR_HELP_COMMAND_DESCRIPTION=${CLEAR}
grep -E '(^[a-zA-Z0-9_-]+:.*##.*$$)|(^##)' Makefile \
| awk "BEGIN {FS = \":.*?## \"}{printf \"${COLOR_MARKER}${COLOR_HELP_COMMAND}%-20s${COLOR_HELP_COMMAND_DESCRIPTION} %s\n\", \$1, \$2}" \
| sed -e "s/\\${COLOR_HELP_COMMAND}##/${COLOR_HELP_GROUP}/"