Skip to content

Commit

Permalink
feat(pip{,3}): add fallback 3rd-party completion loader
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Sep 18, 2023
1 parent f1c085c commit e3cbfba
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions completions/.gitignore
Expand Up @@ -211,6 +211,7 @@
/pinfo
/ping4
/ping6
/_pip3
/pkg_deinstall
/pkg_info
/pkgconf
Expand Down
4 changes: 4 additions & 0 deletions completions/Makefile.am
Expand Up @@ -316,6 +316,7 @@ bashcomp_DATA = 2to3 \
pidof \
pine \
ping \
_pip \
_pipenv \
pkg-config \
pkg-get \
Expand Down Expand Up @@ -751,6 +752,7 @@ CLEANFILES = \
pinfo \
ping4 \
ping6 \
_pip3 \
pkg_deinstall \
pkg_info \
pkgconf \
Expand Down Expand Up @@ -1126,6 +1128,8 @@ symlinks: $(DATA)
alpine
$(ss) ping \
ping4 ping6
$(ss) _pip \
_pip3
$(ss) _pipenv \
_black _blackd _flask _httpx
$(ss) pkg-config \
Expand Down
9 changes: 9 additions & 0 deletions completions/_pip
@@ -0,0 +1,9 @@
# 3rd party completion loader for commands emitting -*- shell-script -*-
# their completion using "$cmd completion --bash". For example, pip uses this
# form of dynamic completions.
#
# This serves as a fallback in case the completion is not installed otherwise.

eval -- "$("$1" completion --bash 2>/dev/null)"

# ex: filetype=sh
1 change: 1 addition & 0 deletions test/fallback/completions/Makefile.am
Expand Up @@ -24,6 +24,7 @@ EXTRA_DIST = \
newgrp \
nmcli \
nox \
pip \
pipenv \
renice \
repomanage \
Expand Down
1 change: 1 addition & 0 deletions test/fallback/completions/pip

0 comments on commit e3cbfba

Please sign in to comment.