From 46ebd0af8a4298cb56e48f841e72fa9fbbbbed69 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Tue, 6 Aug 2024 00:44:10 +0800 Subject: [PATCH] contrib: link zpool to zfs in bash-completion (#16376) Currently user won't have completion of `zpool` command until they trigger completion of `zfs` first. This patch adds a link to `zfs`, thus user can use both to initialize the completion. Fixes: #16320 Signed-off-by: Shengqi Chen Reviewed-by: Tony Hutter Reviewed-by: Rob Norris Reviewed-by: Tino Reichardt --- contrib/bash_completion.d/.gitignore | 1 + contrib/bash_completion.d/Makefile.am | 12 ++++++++---- rpm/generic/zfs.spec.in | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/contrib/bash_completion.d/.gitignore b/contrib/bash_completion.d/.gitignore index 0fd9cc63af..217893a6bd 100644 --- a/contrib/bash_completion.d/.gitignore +++ b/contrib/bash_completion.d/.gitignore @@ -1 +1,2 @@ /zfs +/zpool diff --git a/contrib/bash_completion.d/Makefile.am b/contrib/bash_completion.d/Makefile.am index 1ec05ed73d..d3e6c0e790 100644 --- a/contrib/bash_completion.d/Makefile.am +++ b/contrib/bash_completion.d/Makefile.am @@ -1,5 +1,9 @@ -nodist_bashcompletion_DATA = %D%/zfs -SUBSTFILES += $(nodist_bashcompletion_DATA) +nodist_bashcompletion_DATA = %D%/zfs %D%/zpool +COMPLETION_FILES = %D%/zfs +SUBSTFILES += $(COMPLETION_FILES) -SHELLCHECKSCRIPTS += $(nodist_bashcompletion_DATA) -$(call SHELLCHECK_OPTS,$(nodist_bashcompletion_DATA)): SHELLCHECK_SHELL = bash +SHELLCHECKSCRIPTS += $(COMPLETION_FILES) +$(call SHELLCHECK_OPTS,$(COMPLETION_FILES)): SHELLCHECK_SHELL = bash + +%D%/zpool: %D%/zfs + $(LN_S) zfs $@ diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in index 2e89abd0ed..c7a00c61f6 100644 --- a/rpm/generic/zfs.spec.in +++ b/rpm/generic/zfs.spec.in @@ -532,6 +532,7 @@ systemctl --system daemon-reload >/dev/null || true %attr(440, root, root) %config(noreplace) %{_sysconfdir}/sudoers.d/* %config(noreplace) %{_bashcompletiondir}/zfs +%config(noreplace) %{_bashcompletiondir}/zpool %files -n libzpool5 %{_libdir}/libzpool.so.*