Skip to content

Commit 8082602

Browse files
committed
feat(keyring): add fallback 3rd party completion loader
https://github.com/jaraco/keyring#tab-completion
1 parent 9e4a48f commit 8082602

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

completions/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ bashcomp_DATA = 2to3 \
210210
jsonschema \
211211
k3b \
212212
kcov \
213+
_keyring \
213214
kill \
214215
killall \
215216
kldload \

completions/_keyring

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# 3rd party completion loader for commands emitting -*- shell-script -*-
2+
# their completion using "$cmd --print-completion bash".
3+
# For example, many Python programs using https://github.com/iterative/shtab do.
4+
#
5+
# This serves as a fallback in case the completion is not installed otherwise.
6+
7+
eval -- "$("$1" --print-completion bash 2>/dev/null)"
8+
9+
# ex: filetype=sh

test/fallback/completions/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ EXTRA_DIST = \
1414
hexdump \
1515
hwclock \
1616
ionice \
17+
keyring \
1718
look \
1819
mdbook \
1920
mock \

test/fallback/completions/keyring

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

0 commit comments

Comments
 (0)