From 6cd1f6f26dc36b3dcf3baa69b385da9a70d11294 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 4 Jul 2024 21:18:04 +0200 Subject: [PATCH] Makefile: add completion target Add a "completion" target to install the generated completion scripts inside the dev-container. As generating this script depends on the docker binary, it calls "make binary" first. Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 3f3ecb94c55266d97749907b948b5db1391d2b25) Signed-off-by: Sebastiaan van Stijn --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 8469c60318..6b529faef0 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,16 @@ mod-outdated: ## check outdated dependencies authors: ## generate AUTHORS file from git history scripts/docs/generate-authors.sh +.PHONY: completion +completion: binary +completion: /etc/bash_completion.d/docker +completion: ## generate and install the completion scripts + +.PHONY: /etc/bash_completion.d/docker +/etc/bash_completion.d/docker: ## generate and install the bash-completion script + mkdir -p /etc/bash_completion.d + docker completion bash > /etc/bash_completion.d/docker + .PHONY: manpages manpages: ## generate man pages from go source and markdown scripts/docs/generate-man.sh