Michal Privoznik 898f972d53 Introduce bash completion
With this change one can get list of domains on the command line:

  $ virt-viewer -c qemu:///system <TAB><TAB>
  dom1   dom2   ... domN

The list of domains is fetched using virsh, hence the dependency
on libvirt-client recorded in the spec file. I think it's fair
to assume that Linux hosts with virt-viewer will have virsh
available too. If they don't, nothing breaks and no error message
is printed.

The completer script is inspired by libvirt.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2019-06-19 13:42:12 +02:00

21 lines
539 B
Makefile

EXTRA_DIST = \
$(PACKAGE)
install-data-local: install-bash-completion
uninstall-local: uninstall-bash-completion
if WITH_BASH_COMPLETION
install-bash-completion:
$(MKDIR_P) "$(DESTDIR)$(BASH_COMPLETIONS_DIR)"
$(INSTALL_SCRIPT) $(srcdir)/$(PACKAGE) \
"$(DESTDIR)$(BASH_COMPLETIONS_DIR)/$(PACKAGE)"
uninstall-bash-completion:
rm -f $(DESTDIR)$(BASH_COMPLETIONS_DIR)/$(PACKAGE)
rmdir $(DESTDIR)$(BASH_COMPLETIONS_DIR) ||:
else ! WITH_BASH_COMPLETION
install-bash-completion:
uninstall-bash-completion:
endif ! WITH_BASH_COMPLETION