tools: show user input variables in make help output
Only show variables defined with ?= and manually split the lines since
they will look different from target lines.
Also add some help section headers to the file.
-RUNTIME ?= podman
-DAYSBACK ?= 7
+##@ General
+
+RUNTIME ?= podman # container command for linter and report-upload
.PHONY: help
help: ## Display this help
- @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
+ @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " make \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^[A-Z_-]+.*=/ { varend=index($$0, "?") - 1; if ( varend > 0 ) { helpstart=index($$0, "#") + 1; printf " var \033[36m%-15s\033[0m %s\n", substr($$0, 0, varend), substr($$0, helpstart) } } /^##@/ { printf "\n \033[1m%s\033[0m\n", substr($$0, 5) } END { printf "\n" }' $(MAKEFILE_LIST)
+
+##@ Linter
.PHONY: image
image: ## Build local container image
@@ -17,14 +20,19 @@ lint: ## run the markdown linter
-v $$(pwd):/workdir:Z \
enhancements-markdownlint:latest
+##@ This Week in Enhancements
+
+DAYSBACK ?= 7 # number of days to include in report
+
REPORT_FILE=this-week/$(shell date +%F).md
+
.PHONY: report report-gen
report: report-gen lint report-upload ## run weekly newsletter report tool
report-gen:
(cd ./tools; go run ./main.go report --days-back $(DAYSBACK) > ../$(REPORT_FILE))
-HACKMD_IMAGE=enhancements-hackmd-cli:latest
+HACKMD_IMAGE=enhancements-hackmd-cli:latest # hackmd-cli image
.PHONY: report-upload
report-upload: report-image
