[pve-devel] [PATCH firewall] 1891 Add zsh command completion for pve-firewall

Christian Ebner c.ebner at proxmox.com
Thu Feb 21 14:24:59 CET 2019


Adds the zsh command completion scripts for pve-firewall.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 src/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/Makefile b/src/Makefile
index 0183a61..2280abd 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -8,6 +8,7 @@ export MAN1DIR=${MANDIR}/man1/
 export MAN8DIR=${MANDIR}/man8/
 export PERLDIR=${PREFIX}/share/perl5
 export BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions
+export ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions
 
 export NOVIEW=1
 include /usr/share/pve-doc-generator/pve-doc-generator.mk
@@ -18,6 +19,10 @@ pve-firewall.bash-completion: PVE/Service/pve_firewall.pm
 	perl -I. -T -e "use PVE::Service::pve_firewall; PVE::Service::pve_firewall->generate_bash_completions();" >$@.tmp
 	mv $@.tmp $@
 
+pve-firewall.zsh-completion: PVE/Service/pve_firewall.pm
+	perl -I. -T -e "use PVE::Service::pve_firewall; PVE::Service::pve_firewall->generate_zsh_completions();" >$@.tmp
+	mv $@.tmp $@
+
 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
 CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
 LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
@@ -28,7 +33,7 @@ pvefw-logger: pvefw-logger.c
 	$(shell pkg-config libnetfilter_log libnetfilter_conntrack glib-2.0 --libs --cflags)
 
 .PHONY: install
-install: pve-firewall pve-firewall.8 pve-firewall.bash-completion pvefw-logger
+install: pve-firewall pve-firewall.8 pve-firewall.bash-completion pve-firewall.zsh-completion pvefw-logger
 	make -C PVE install
 	install -d -m 0755 ${DESTDIR}/${SBINDIR}
 	install -m 0755 pve-firewall ${DESTDIR}/${SBINDIR}
@@ -36,6 +41,7 @@ install: pve-firewall pve-firewall.8 pve-firewall.bash-completion pvefw-logger
 	install -d ${DESTDIR}/${MAN8DIR}
 	install -m 0644 pve-firewall.8 ${DESTDIR}/${MAN8DIR}
 	install -m 0644 -D pve-firewall.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/pve-firewall
+	install -m 0644 -D pve-firewall.zsh-completion ${DESTDIR}/${ZSHCOMPLDIR}/_pve-firewall
 	install -d -m 0755 ${DESTDIR}/usr/lib/sysctl.d/
 	install -m 0644 pve-firewall-sysctl.conf ${DESTDIR}/usr/lib/sysctl.d/pve-firewall.conf
 
-- 
2.11.0



More information about the pve-devel mailing list