Created
November 27, 2024 13:00
-
-
Save hermannolafs/ae911d2a2cd5d38b35ec90d1ac8f0764 to your computer and use it in GitHub Desktop.
AWK Makefile help message,
This file contains hidden or 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
.DEFAULT_GOAL := help | |
.PHONY: help | |
help: ## This help message | |
@awk -F '[, ]+' '/^[a-zA-Z0-9_-]+:.*##/ { \ | |
target = $$0; \ | |
sub(/^[ \t]*/, "", target); \ | |
sub(/:.*##/, "##", target); \ | |
split(target, parts, "##"); \ | |
gsub(/^[ \t]*|[ \t]*$$/, "", parts[1]); \ | |
gsub(/^[ \t]*|[ \t]*$$/, "", parts[2]); \ | |
printf "%-30s %s\n", parts[1], parts[2]; \ | |
}' $(MAKEFILE_LIST) | |
create-venv: ## Create python virtual environment at .venv | |
python3.12 -m venv .venv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's another implementation (by
claude-sonnet-3.7-thinking
)Furthermore, I asked it which was better: