diff --git a/share/completions/pip.fish b/share/completions/pip.fish index 4007379b8..1834d93a5 100644 --- a/share/completions/pip.fish +++ b/share/completions/pip.fish @@ -1 +1,2 @@ -pip completion --fish 2>/dev/null | source +__fish_cache_sourced_completions pip completion --fish 2>/dev/null +or pip completion --fish 2>/dev/null | source diff --git a/share/completions/pip2.fish b/share/completions/pip2.fish index 11f834d04..30ca99f19 100644 --- a/share/completions/pip2.fish +++ b/share/completions/pip2.fish @@ -1,5 +1,2 @@ -# pip[2|3] emits (or emitted) completions with the wrong command name -# See discussion at https://github.com/fish-shell/fish-shell/pull/4448 -# and pip bug at https://github.com/pypa/pip/pull/4755 -# Keep this even after pip fix is upstreamed for users not on the latest pip -pip2 completion --fish 2>/dev/null | string replace -r -- " -c\s+pip\b" " -c pip2" | source +__fish_cache_sourced_completions pip2 completion --fish 2>/dev/null +or pip2 completion --fish 2>/dev/null | source diff --git a/share/completions/pip3.fish b/share/completions/pip3.fish index b42fc5491..7e986e5ee 100644 --- a/share/completions/pip3.fish +++ b/share/completions/pip3.fish @@ -1,5 +1,2 @@ -# pip[2|3] emits (or emitted) completions with the wrong command name -# See discussion at https://github.com/fish-shell/fish-shell/pull/4448 -# and pip bug at https://github.com/pypa/pip/pull/4755 -# Keep this even after pip fix is upstreamed for users not on the latest pip -pip3 completion --fish 2>/dev/null | string replace -r -- " -c\s+pip\b" " -c pip3" | source +__fish_cache_sourced_completions pip3 completion --fish 2>/dev/null +or pip3 completion --fish 2>/dev/null | source diff --git a/share/completions/pipenv.fish b/share/completions/pipenv.fish index 4dcd1be23..75cccf048 100644 --- a/share/completions/pipenv.fish +++ b/share/completions/pipenv.fish @@ -1,12 +1,5 @@ -# try new completion generation of click first -set -l comps (_PIPENV_COMPLETE=fish_source pipenv 2>/dev/null) -if test -z "$comps" || string match -q 'Usage:*' -- $comps - # fall back to older click-completion used in prior versions - set comps (_PIPENV_COMPLETE=source-fish pipenv --completion 2>/dev/null) -end - -set -q comps[1] && printf %s\n $comps | source - +_PIPENV_COMPLETE=fish_source __fish_cache_sourced_completions pipenv 2>/dev/null +or _PIPENV_COMPLETE=fish_source pipenv 2>/dev/null | source # manual workaround for pipenv run command completion until this is supported by the built-in mechanism complete -c pipenv -n "__fish_seen_subcommand_from run" -a "(__fish_complete_subcommand --fcs-skip=2)" -x