Skip to content

Commit

Permalink
Merge pull request #9190 from edsantiago/make_completions
Browse files Browse the repository at this point in the history
New 'make completions' target
  • Loading branch information
openshift-merge-robot authored Feb 2, 2021
2 parents 48a0e00 + ee8ee65 commit 52575db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion completions/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Podman offers shell completion scripts for bash, zsh and fish. The completion scripts are available for both `podman` and `podman-remote`.

The shell completion scripts are generated by `make completion`, do not edit these files directly. To install them you can run `sudo make install.completions`.
The shell completion scripts are generated by `make completions`; do not edit these files directly. To install them you can run `sudo make install.completions`.

For information about these scripts see [`man podman-completion`](../docs/source/markdown/podman-completion.1.md)

0 comments on commit 52575db

Please sign in to comment.