From cbb699ab9c5f09b71bf1396c78598f107afc8437 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 10 Jan 2019 13:30:03 +0100 Subject: [PATCH] Makefile: make help: fix newline wrapping, and missing targets This patch adds support for multiple newlines and removes the 1-space indentation of wrapped lines. Given these targets: ```Makefile .PHONY: foobar foobar: ## runs the foobar lorum ipsum.\nand so pn\nand so on echo foobar ``` Before this change, the output of `make help` was ``` foobar runs the foobar lorum ipsum. and so pn\nand so on ``` After this change, the output is: ``` foobar runs the foobar lorum ipsum. and so pn and so on ``` Signed-off-by: Sebastiaan van Stijn --- Makefile | 2 +- docker.Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 09fbfb202c..6f0ff4b008 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ shellcheck: ## run shellcheck validation .PHONY: help help: ## print this help - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) cli/compose/schema/bindata.go: cli/compose/schema/data/*.json diff --git a/docker.Makefile b/docker.Makefile index c8f6de2172..19bbe02b6b 100644 --- a/docker.Makefile +++ b/docker.Makefile @@ -136,4 +136,4 @@ test-e2e-connhelper-ssh: build_e2e_image # run experimental SSH-connection helpe .PHONY: help help: ## print this help - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)