add 'wheel' to pip completion

This commit is contained in:
niris 2013-07-26 17:58:01 +08:00
parent 52c096280e
commit b91db13f5c
1 changed files with 36 additions and 25 deletions

View File

@ -51,6 +51,7 @@ case $state in
"list:list installed packages"
"show:show information about installed packages"
"search:search pypi"
"wheel:build wheels from your requirements"
"zip:zip dividual packages"
"unzip:unzip undividual packages"
"bundle:create pybundle"
@ -66,36 +67,26 @@ case $state in
$common_ops
)
local -a requirement
requirement=(
{-r,--requirement=}"[install all the packages listed in the given requirements file]:filename:_files"
)
local -a findlink
findlink=(
{-f,--find-links=}"[URL to look for packages at]:url"
)
local -a local_env
local_env=(
{-l,--local}"[If in a virtualenv that has global access, do not list globally-installed packages]"
)
local -a pi_ops
pi_ops=(
$findlink
{-i,--index-url=}"[base URL of Python Package Index]:URL"
{-M,--use-mirrors}"[use the PyPI mirrors as a fallback in case the main index is down]"
"--mirrors=[specific mirror URLs to query when --use-mirrors is used]:URL"
"--extra-index-url=[extra URLs of package indexes to use in addition to --index-url]:URL"
"--no-index[ignore package index (only looking at --find-links URLs instead)]"
{-f,--find-links=}"[URL to look for packages at]:URL"
{-M,--use-mirrors}"[use the PyPI mirrors as a fallback in case the main index is down]"
"--mirrors=[specific mirror URLs to query when --use-mirrors is used]:URL"
"--allow-external=[allow the installation of externally hosted files]:package"
"--allow-all-external[allow the installation of all externally hosted files]"
"--no-allow-external[disallow the installation of all externally hosted files]"
"--allow-insecure=[allow the installation of insecure and unverifiable files]:package"
"--no-allow-insecure[disallow the installation of insecure and unverifiable files]"
)
case $words[1] in
install | bundle)
args+=(
{-e,--editable=}"[install a package directly from a checkout]:VCS+REPOS_URL[@REV]#egg=PACKAGE"
$requirement
{-r,--requirement=}"[install all the packages listed in the given requirements file]:filename:_files"
{-b,--build=}"[unpack packages into DIR]:directory:_directories"
{-t,--target=}"[install packages into DIR]:directory:_directories"
{-d,--download=}"[download packages into DIR instead of installing them]:directory:_directories"
@ -112,22 +103,25 @@ case $state in
"--user[install using the user scheme]"
"--egg[install as self contained egg file, like easy_install does]"
"--root=[Install everything relative to this alternate root directory]:directory:_directories"
"--use-wheel[find and prefer wheel archives when searching indexes and find-links locations]"
"--pre[include pre-release and development versions]"
"--no-clean[don't clean up build directories]"
$pi_ops
)
;;
uninstall)
args+=(
$requirement
{-r,--requirement=}"[install all the packages listed in the given requirements file]:filename:_files"
{-y,--yes}"[don't ask for confirmation of uninstall deletions]"
)
;;
freeze)
args+=(
$requirement
$findlink
$local_env
{-r,--requirement=}"[install all the packages listed in the given requirements file]:filename:_files"
{-f,--find-links=}"[URL to look for packages at]:URL"
{-l,--local}"[If in a virtualenv that has global access, do not list globally-installed packages]"
)
;;
@ -136,7 +130,8 @@ case $state in
{-o,--outdated}"[list outdated packages (excluding editables)]"
{-u,--uptodated}"[list uptodated packages (excluding editables)]"
{-e,--editable}"[list editable projects]"
$local_env
{-l,--local}"[If in a virtualenv that has global access, do not list globally-installed packages]"
"--pre[include pre-release and development versions]"
$pi_ops
)
;;
@ -149,7 +144,23 @@ case $state in
search)
args+=(
"--index-url[base URL of Python Package Index]:URL"
"--index[base URL of Python Package Index]:URL"
)
;;
wheel)
args+=(
{-w,--wheel-dir=}"[build wheels into DIR, where the default is '<cwd>/wheelhouse']:directory:_directories"
"--use-wheel[find and prefer wheel archives when searching indexes and find-links locations]"
"--build-option=[extra arguments to be supplied to 'setup.py bdist_wheel']:options"
{-r,--requirement=}"[install all the packages listed in the given requirements file]:filename:_files"
"--download-cache=[cache downloaded packages in DIR]:directory:_directories"
"--no-deps[don't install package dependencies]"
{-b,--build=}"[directory to unpack packages into and build in]:directory:_directories"
"--global-option=[extra global options to be supplied to the setup.py call before the 'bdist_wheel' command]:options"
"--pre[include pre-release and development versions]"
"--no-clean[don't clean up build directories]"
$pi_ops
)
;;