Skip to content

Commit

Permalink
🆕 feat(help.mak): add help command to Makefile
Browse files Browse the repository at this point in the history
The help command is added to the Makefile to provide a list of available commands and their descriptions. The command uses grep and awk to parse the Makefile and display the commands in a formatted way.
  • Loading branch information
ThomasSanson committed Jun 10, 2023
1 parent 8153b1c commit 14ede58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .config/make/help.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## —— Help ———————————————————————————————————————————————————————————————————————————————————————
.PHONY: help
help: ## Help command
echo -e "$$HEADER"
grep -E '(^[a-zA-Z0-9_-]+:.*?## .*$$)|(^## )' $(MAKEFILE_LIST) | sed 's/^[^:]*://g' | awk 'BEGIN {FS = ":.*?## | #"} ; {printf "${cyan}%-30s${reset} ${white}%s${reset} ${green}%s${reset}\n", $$1, $$2, $$3}' | sed -e 's/\[36m##/\n[32m##/'

0 comments on commit 14ede58

Please sign in to comment.