Skip to content

Commit f695c54

Browse files
committed
feat(mdbook): add fallback 3rd party completion loader
1 parent 77c9fd6 commit f695c54

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
@@ -253,6 +253,7 @@ bashcomp_DATA = 2to3 \
253253
mc \
254254
mcrypt \
255255
mdadm \
256+
_mdbook \
256257
mdtool \
257258
medusa \
258259
mii-diag \

completions/_mdbook

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 emitting -*- shell-script -*-
2+
# their completion using "$cmd completions bash".
3+
#
4+
# This serves as a fallback in case the completion is not installed otherwise.
5+
6+
eval -- "$("$1" completions bash 2>/dev/null)"
7+
8+
# 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
hwclock \
1515
ionice \
1616
look \
17+
mdbook \
1718
mock \
1819
modules \
1920
mount \

test/fallback/completions/mdbook

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

0 commit comments

Comments
 (0)