You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
48 lines
1.2 KiB
15 years ago
|
#compdef pip
|
||
|
#autoload
|
||
|
|
||
14 years ago
|
# This completion is based on the Homebrew completion.
|
||
15 years ago
|
|
||
14 years ago
|
function _pip-installed() {
|
||
15 years ago
|
installed_pkgs=(`pip freeze`)
|
||
|
}
|
||
|
|
||
|
local -a _1st_arguments
|
||
|
_1st_arguments=(
|
||
|
'bundle:Create pybundles (archives containing multiple packages)'
|
||
|
'freeze:Output all currently installed packages (exact versions) to stdout'
|
||
|
'help:Show available commands'
|
||
|
'install:Install packages'
|
||
|
'search:Search PyPI'
|
||
|
'uninstall:Uninstall packages'
|
||
|
'unzip:Unzip individual packages'
|
||
|
'zip:Zip individual packages'
|
||
|
)
|
||
|
|
||
|
local expl
|
||
|
local -a pkgs installed_pkgs
|
||
|
|
||
|
_arguments \
|
||
|
'(--version)--version[Show version number of program and exit]' \
|
||
|
'(-v --verbose)'{-v,--verbose}'[Give more output]' \
|
||
|
'(-q --quiet)'{-q,--quiet}'[Give less output]' \
|
||
|
'(-h --help)'{-h,--help}'[Show help]' \
|
||
|
'*:: :->subcmds' && return 0
|
||
|
|
||
|
if (( CURRENT == 1 )); then
|
||
|
_describe -t commands "pip subcommand" _1st_arguments
|
||
|
return
|
||
|
fi
|
||
|
|
||
|
case "$words[1]" in
|
||
|
list)
|
||
|
if [[ "$state" == forms ]]; then
|
||
14 years ago
|
_pip-installed
|
||
15 years ago
|
_requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
|
||
|
fi ;;
|
||
|
uninstall)
|
||
14 years ago
|
_pip-installed
|
||
15 years ago
|
_wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
|
||
|
esac
|
||
14 years ago
|
|