nhplus/bin/make/help.sh

11 lines
No EOL
472 B
Bash
Executable file

#!/bin/bash
source bin/make/colors.sh
COLOR_HELP_GROUP=${COLOR_START}${COLOR_FG}${COLOR_YELLOW}${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}/"