Skip to content

Commit

Permalink
contrib: link zpool to zfs in bash-completion (openzfs#16376)
Browse files Browse the repository at this point in the history
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: openzfs#16320

Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
  • Loading branch information
Harry-Chen authored Aug 5, 2024
1 parent 1fdcb65 commit 46ebd0a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions contrib/bash_completion.d/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/zfs
/zpool
12 changes: 8 additions & 4 deletions contrib/bash_completion.d/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 $@
1 change: 1 addition & 0 deletions rpm/generic/zfs.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down

0 comments on commit 46ebd0a

Please sign in to comment.