From 1770e47eb0e3d7f6676e775e2133d0aa32d7730a Mon Sep 17 00:00:00 2001 From: Cristian Prieto Date: Thu, 5 Oct 2017 15:15:41 +1100 Subject: [PATCH] Python's pip and pipenv completions (#4448) * Add pip completion * We call native pip completion for fish if pip is installed * Add pipenv completion * We call pipenv native completion if pipenv is installed * Applied changes as requested by @floam * Changed usage of `test (command -v)` for just `command -sq` * Add completions for pip2/3 * In some systems pip is not aliased and we have pip2 and pip3 * In those cases, we just load the completions for those commands * Separate pip2/3 completions in their own file as requested by @floam --- share/completions/pip.fish | 4 ++++ share/completions/pip2.fish | 3 +++ share/completions/pip3.fish | 3 +++ share/completions/pipenv.fish | 3 +++ 4 files changed, 13 insertions(+) create mode 100644 share/completions/pip.fish create mode 100644 share/completions/pip2.fish create mode 100644 share/completions/pip3.fish create mode 100644 share/completions/pipenv.fish diff --git a/share/completions/pip.fish b/share/completions/pip.fish new file mode 100644 index 000000000..52332f599 --- /dev/null +++ b/share/completions/pip.fish @@ -0,0 +1,4 @@ +if command -sq pip + eval (pip completion --fish) +end + diff --git a/share/completions/pip2.fish b/share/completions/pip2.fish new file mode 100644 index 000000000..a0297f081 --- /dev/null +++ b/share/completions/pip2.fish @@ -0,0 +1,3 @@ +if command -sq pip2 + eval (pip2 completion --fish) +end diff --git a/share/completions/pip3.fish b/share/completions/pip3.fish new file mode 100644 index 000000000..25b1918e3 --- /dev/null +++ b/share/completions/pip3.fish @@ -0,0 +1,3 @@ +if command -sq pip3 + eval (pip3 completion --fish) +end diff --git a/share/completions/pipenv.fish b/share/completions/pipenv.fish new file mode 100644 index 000000000..fce46933c --- /dev/null +++ b/share/completions/pipenv.fish @@ -0,0 +1,3 @@ +if command -sq pipenv + eval (pipenv --completion) +end