summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-01 20:45:15 -0500
committerGitHub <noreply@github.com>2021-02-01 20:45:15 -0500
commit52575db9b40ad141dc5521d7646e8ed636651b54 (patch)
treec10a47324a03ca838d9e89fdf02cabd3da7a3a3e /Makefile
parent48a0e002d5303a36e35de1237e952de749c2b7ee (diff)
parentee8ee651d523bd853ce0075ebd2bc02a02c4ed95 (diff)
downloadpodman-52575db9b40ad141dc5521d7646e8ed636651b54.tar.gz
podman-52575db9b40ad141dc5521d7646e8ed636651b54.tar.bz2
podman-52575db9b40ad141dc5521d7646e8ed636651b54.zip
Merge pull request #9190 from edsantiago/make_completions
New 'make completions' target
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index dfa36e3ef..a5e126176 100644
--- a/Makefile
+++ b/Makefile
@@ -639,6 +639,18 @@ install.libseccomp.sudo:
cd ../../seccomp/libseccomp && git checkout --detach $(LIBSECCOMP_COMMIT) && ./autogen.sh && ./configure --prefix=/usr && make all && make install
+.PHONY: completions
+completions: podman podman-remote
+ # key = shell, value = completion filename
+ declare -A outfiles=([bash]=%s [zsh]=_%s [fish]=%s.fish);\
+ for shell in $${!outfiles[*]}; do \
+ for remote in "" "-remote"; do \
+ podman="podman$$remote"; \
+ outfile=$$(printf "completions/$$shell/$${outfiles[$$shell]}" $$podman); \
+ ./bin/$$podman completion $$shell >| $$outfile; \
+ done;\
+ done
+
.PHONY: validate.completions
validate.completions: SHELL:=/usr/bin/env bash # Set shell to bash for this target
validate.completions: