Skip to content

Commit 3303515

Browse files
committed
feat(vault): add fallback 3rd party completion loader
1 parent 9a3679e commit 3303515

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

completions/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ bashcomp_DATA = 2to3 \
445445
userdel \
446446
usermod \
447447
valgrind \
448+
_vault \
448449
vipw \
449450
vmstat \
450451
vncviewer \

completions/_vault

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 3rd party completion loader for commands -*- shell-script -*-
2+
# supporting their use of as a `complete -C` handler.
3+
#
4+
# This serves as a fallback in case the completion is not installed otherwise.
5+
6+
type "$1" &>/dev/null && complete -C "\"$1\" 2>/dev/null" "$1" "${1##*/}"
7+
8+
# ex: filetype=sh

test/fallback/completions/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ EXTRA_DIST = \
3434
udevadm \
3535
umount \
3636
umount.linux \
37+
vault \
3738
write \
3839
xm \
3940
yq \

test/fallback/completions/vault

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../completions/_vault

0 commit comments

Comments
 (0)