-
Notifications
You must be signed in to change notification settings - Fork 4
/
_vz
34 lines (30 loc) · 1.08 KB
/
_vz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#compdef vz
local -a vz_commands
for file in "${_virtualz_dir}"/doc/cmd-*.txt ; do
local cmd=${file#*/cmd-}
vz_commands+=( "${cmd%.txt}:$(read -re < "${file}")" )
done
local -a vz_virtualenvs=( $(vz ls) )
typeset -A opt_args
local state
_arguments \
"1: :{_describe 'command' vz_commands -- 'virtualenv' vz_virtualenvs}" \
'*:: :->args'
case ${words[1]} in
activate | rm)
_arguments "1: :{_describe 'virtualenv' vz_virtualenvs}"
;;
new)
_arguments \
'1:virtualenv name:' \
'(-v --verbose)'{-v,--verbose}'[Increase verbosity]' \
'(-q --quiet)'{-q,--quiet}'[Decrease verbosity]' \
'(-p --python)'{-p,--python=-}'[The Python interpreter to use]:files:_files' \
'--system-site-packages[Give the virtual environment access to the global site-packages]' \
'--always-copy[Always copy files rather than symlinking]' \
'--unzip-setuptools[Unzip Setuptools when installing it]' \
'--no-setuptools[Do not install setuptools in the new virtualenv]' \
'--no-pip[Do not install pip in the new virtualenv]' \
'--no-wheel[Do not install wheel in the new virtualenv]'
;;
esac