nhplus/bin/make/help.sh

11 lines
472 B
Bash
Raw Permalink Normal View History

2024-04-10 14:03:19 +00:00
#!/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}/"