Skip to content

Commit b161be8

Browse files
committed
feat(flamegraph): add fallback 3rd party completion loader
1 parent 2ae33fa commit b161be8

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
@@ -118,6 +118,7 @@ bashcomp_DATA = 2to3 \
118118
fio \
119119
firefox \
120120
flake8 \
121+
_flamegraph \
121122
freebsd-update \
122123
freeciv \
123124
freeciv-server \

completions/_flamegraph

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
@@ -6,6 +6,7 @@ EXTRA_DIST = \
66
chsh \
77
dmesg \
88
eject \
9+
flamegraph \
910
gaiacli \
1011
gh \
1112
golangci-lint \

test/fallback/completions/flamegraph

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

0 commit comments

Comments
 (0)