Created
September 8, 2018 17:40
-
-
Save Xisabla/5cb2663e8eb1b935bdde683699e195ff to your computer and use it in GitHub Desktop.
Makefile help parsing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
help: ## Show this help. | |
@printf "\033[32m%-30s \033[32m %s\n" "VARIABLE NAME" "DEFAULT_VALUE" | |
@grep -E '^[a-zA-Z_-]+(\?=|=).*$$' $(MAKEFILE_LIST) |sort | awk 'BEGIN {FS = "(?=|=)"}; {printf "\033[36m%-30s \033[0m %s\n", $$1, $$2}' | |
@printf "\n\033[32m%-30s \033[32m %s\033[0m\n" "RECIPE" "DESCRIPTION" | |
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "make \033[36m%-30s\033[0m %s\n", $$1, $$2}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment