vzdump: add bash completion support

This commit is contained in:
Dietmar Maurer 2015-09-02 15:29:54 +02:00
parent aede93f965
commit 5c92234706
4 changed files with 13 additions and 2 deletions

View File

@ -70,7 +70,8 @@ pvemailforward: pvemailforward.c
gcc $< -o $@ -g -O2 -Wall -ldl -lc
.PHONY: install
install: ${SCRIPTS} ${MANS} pvemailforward
install: ${SCRIPTS} ${MANS} pvemailforward vzdump.bash-completion
perl -I.. ./pvesh verifyapi
install -d ${BINDIR}
install -m 0755 ${SCRIPTS} ${BINDIR}
@ -80,6 +81,7 @@ install: ${SCRIPTS} ${MANS} pvemailforward
install -d ${PODDIR}
install -m 0644 vzdump.1.pod ${PODDIR}
install -m 0644 pvesubscription.1.pod ${PODDIR}
install -m 0644 -D vzdump.bash-completion ${BASHCOMPLDIR}/vzdump
set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
.PHONY: distclean

View File

@ -26,7 +26,7 @@ $rpcenv->set_language($ENV{LANG});
$rpcenv->set_user('root@pam');
my $cmddef = [ 'PVE::API2::VZDump', 'vzdump', 'vmid', undef,
my $cmddef = [ 'PVE::API2::VZDump', 'vzdump', ['vmid'], undef,
sub {
my $upid = shift;
exit(0) if $upid eq 'OK';

View File

@ -0,0 +1,8 @@
# vzdump bash completion
# see http://tiswww.case.edu/php/chet/bash/FAQ
# and __ltrim_colon_completions() in /usr/share/bash-completion/bash_completion
# this modifies global var, but I found no better way
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
complete -C 'vzdump bashcomplete' vzdump

View File

@ -10,6 +10,7 @@ MAN1DIR=${DESTDIR}/usr/share/man/man1
CRONDAILYDIR=${DESTDIR}/etc/cron.daily
INITDBINDIR=${DESTDIR}/etc/init.d
SERVICEDIR=${DESTDIR}/lib/systemd/system
BASHCOMPLDIR=${DESTDIR}/usr/share/bash-completion/completions/
HARADIR=${DESTDIR}/usr/share/cluster
DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
PODDIR=${DESTDIR}/usr/share/doc/${PACKAGE}/pod