Improve pip plugin options support
* -r, --record now looks for a local file instead of trying to cache
the entire package index
* add --editable because it's useful
* add --single-version-externally-managed because it is too long
* add --record and --root because they're required by
--single-version-externally-managed
Diff
1diff --git a/plugins/pip/_pip b/plugins/pip/_pip
2index df53ba5ce8ec788d3ff7da94a9936ffee94267db..fb8765c7e5d488adde84481d260e06b18279f7be 100644
3--- a/plugins/pip/_pip
4+++ b/plugins/pip/_pip
5@@ -6,8 +6,8 @@
6 _pip_all() {
7 # we cache the list of packages (originally from the macports plugin)
8 if (( ! $+piplist )); then
9- echo -n " (caching package index...)"
10- piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'))
11+ echo -n " (caching package index...)"
12+ piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'))
13 fi
14 }
1516@@ -62,8 +62,13 @@ case "$words[1]" in
17 '(--no-install)--no-install[only download packages]' \
18 '(--no-download)--no-download[only install downloaded packages]' \
19 '(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \
20+ '(--single-version-externally-managed)--single-version-externally-managed[do not download/install dependencies. requires --record or --root]'\
21+ '(--root)--root[treat this path as a fake chroot, installing into it. implies --single-version-externally-managed]'\
22+ '(--record)--record[file to record all installed files to.]'\
23+ '(-r --requirement)'{-r,--requirement}'[requirements file]: :_files'\
24+ '(-e --editable)'{-e,--editable}'[path of or url to source to link to instead of installing.]: :_files -/'\
25 '1: :->packages' && return 0
26-
27+
28 if [[ "$state" == packages ]]; then
29 _pip_all
30 _wanted piplist expl 'packages' compadd -a piplist