Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pipenv): add fallback 3rd party completion loader #1020

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions completions/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ bashcomp_DATA = 2to3 \
pidof \
pine \
ping \
_pipenv \
pkg-config \
pkg-get \
pkg_delete \
Expand Down
15 changes: 15 additions & 0 deletions completions/_pipenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 3rd party completion loader for commands emitting -*- shell-script -*-
# their completion using "_${cmdname^^}_COMPLETE=bash_source $cmd".
# This pattern is used by programs built with https://click.palletsprojects.com
#
# This serves as a fallback in case the completion is not installed otherwise.

eval -- "$(
# shellcheck disable=SC2154
ucname="${cmdname^^}"
ucname=${ucname//-/_}
eval "v=_${ucname}_COMPLETE=bash_source; export \$v"
"$1" 2>/dev/null
scop marked this conversation as resolved.
Show resolved Hide resolved
)"

# 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 @@ -24,6 +24,7 @@ EXTRA_DIST = \
newgrp \
nmcli \
nox \
pipenv \
renice \
repomanage \
reptyr \
Expand Down
1 change: 1 addition & 0 deletions test/fallback/completions/pipenv