Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
fe09064f
Commit
fe09064f
authored
Sep 01, 2010
by
Daniel Schauenberg
Browse files
add pip completion and plugin
parent
99f159e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
functions/pip/_pip
0 → 100644
View file @
fe09064f
#compdef pip
#autoload
# pip zsh completion, based on homebrew completion
_pip_installed() {
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
_pip_installed
_requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
fi ;;
uninstall)
_pip_installed
_wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
esac
plugins/pip.plugin.zsh
0 → 100644
View file @
fe09064f
# add brew completion function to path
fpath
=(
$ZSH
/functions/pip
$fpath
)
autoload
-U
compinit
compinit
-i
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment