Commit 5c922347 authored by Dietmar Maurer's avatar Dietmar Maurer

vzdump: add bash completion support

parent aede93f9
......@@ -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
......
......@@ -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';
......
# 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
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment