Skip to content

Commit 7e4cc2f

Browse files
committed
feat(rg): add fallback 3rd party completion loader
https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#complete
1 parent a89cde2 commit 7e4cc2f

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

completions/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ bashcomp_DATA = 2to3 \
377377
_reptyr \
378378
resolvconf \
379379
_rfkill \
380+
_rg \
380381
ri \
381382
rmlist \
382383
rmmod \

completions/_rg

+8
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 --generate complete-bash".
3+
#
4+
# This serves as a fallback in case the completion is not installed otherwise.
5+
6+
eval -- "$("$1" --generate complete-bash 2>/dev/null)"
7+
8+
# ex: filetype=sh

test/fallback/completions/rg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../completions/_rg

0 commit comments

Comments
 (0)