Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions completions/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ bashcomp_DATA = 2to3 \
jshint \
json_xs \
jsonschema \
_jungle \
k3b \
kcov \
_keyring \
Expand Down
16 changes: 16 additions & 0 deletions completions/_jungle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 3rd party completion loader for commands emitting -*- shell-script -*-
# their completion using "_${cmdname^^}_COMPLETE=source $cmd".
# This pattern is very similar to `completions/_pipenv`, but the value of the
# environment variable is slightly different.
#
# This serves as a fallback in case the completion is not installed otherwise.

eval -- "$(
# shellcheck disable=SC2154
ucname="${cmdname^^}"
ucname=${ucname//-/_}
export "_${ucname}_COMPLETE=source"
"$1" 2>/dev/null
)"

# ex: filetype=sh
1 change: 1 addition & 0 deletions test/fallback/completions/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ EXTRA_DIST = \
hexdump \
hwclock \
ionice \
jungle \
keyring \
kontena \
look \
Expand Down
1 change: 1 addition & 0 deletions test/fallback/completions/jungle

0 comments on commit c69845a

Please sign in to comment.