mirror of
https://github.com/conda-incubator/conda-zsh-completion.git
synced 2026-03-04 06:14:59 +08:00
Merge pull request #57 from jnooree/backport
Improvements in completion usability
This commit is contained in:
14
_conda
14
_conda
@@ -204,7 +204,7 @@ __conda_envs(){
|
|||||||
|
|
||||||
# unmaned envs (if show-unammed).
|
# unmaned envs (if show-unammed).
|
||||||
if test -n "$unnamed"; then
|
if test -n "$unnamed"; then
|
||||||
envs+=($( (test -n "$unnamed" && cat ${HOME:?}/.conda/environments.txt) | cut -f1 -d' ' | sed -e "s|^${PWD}|.|" | sed -e "s|^$localenvspath/||"))
|
envs+=($( (cat ${HOME:?}/.conda/environments.txt) 2>/dev/null | cut -f1 -d' ' | sed -e "s|^${PWD}|.|" | sed -e "s|^$localenvspath/||"))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_describe $describe_opts -t envs 'conda environments' envs
|
_describe $describe_opts -t envs 'conda environments' envs
|
||||||
@@ -462,7 +462,7 @@ json_opts=(
|
|||||||
|
|
||||||
env_opts=(
|
env_opts=(
|
||||||
'(-n --name -p --prefix)'{-n,--name}'[name of environment]:environment:__conda_envs' \
|
'(-n --name -p --prefix)'{-n,--name}'[name of environment]:environment:__conda_envs' \
|
||||||
'(-n --name -p --prefix)'{-p,--prefix}'[full path to environment prefix]:path:_path_files' \
|
'(-n --name -p --prefix)'{-p,--prefix}'[full path to environment prefix]:prefix:_directories' \
|
||||||
)
|
)
|
||||||
|
|
||||||
channel_opts=(
|
channel_opts=(
|
||||||
@@ -703,18 +703,19 @@ case $state in
|
|||||||
(create)
|
(create)
|
||||||
_arguments -C $help_opts \
|
_arguments -C $help_opts \
|
||||||
$json_opts \
|
$json_opts \
|
||||||
'(-n --name)'{-n,--name}'[name of environment]:environment:__conda_envs' \
|
$env_opts \
|
||||||
'(-f --file)'{-f,--file}'[environment definition]:file:_path_files' \
|
'(-f --file)'{-f,--file}'[environment definition]:file:_path_files' \
|
||||||
'(-q --quiet)'{-q,--quiet}'[]' \
|
'(-q --quiet)'{-q,--quiet}'[]' \
|
||||||
;;
|
;;
|
||||||
(export)
|
(export)
|
||||||
_arguments -C $help_opts \
|
_arguments -C $help_opts \
|
||||||
'(-n --name)'{-n,--name}'[name of environment]:environment:__conda_envs' \
|
$env_opts \
|
||||||
'(-f --file)'{-f,--file}'[]:file:_path_files' \
|
'(-f --file)'{-f,--file}'[]:file:_path_files' \
|
||||||
;;
|
;;
|
||||||
(list)
|
(list)
|
||||||
_arguments -C $help_opts \
|
_arguments -C $help_opts \
|
||||||
$json_opts \
|
$json_opts \
|
||||||
|
$env_opts
|
||||||
;;
|
;;
|
||||||
(remove)
|
(remove)
|
||||||
_arguments -C $help_opts \
|
_arguments -C $help_opts \
|
||||||
@@ -727,7 +728,7 @@ case $state in
|
|||||||
(update)
|
(update)
|
||||||
_arguments -C $help_opts \
|
_arguments -C $help_opts \
|
||||||
$json_opts \
|
$json_opts \
|
||||||
'(-n --name)'{-n,--name}'[name of environment]:environment:__conda_envs' \
|
$env_opts \
|
||||||
'(-f --file)'{-f,--file}'[environment definition]:file:_path_files' \
|
'(-f --file)'{-f,--file}'[environment definition]:file:_path_files' \
|
||||||
'(-q --quiet)'{-q,--quiet}'[]' \
|
'(-q --quiet)'{-q,--quiet}'[]' \
|
||||||
;;
|
;;
|
||||||
@@ -738,7 +739,7 @@ case $state in
|
|||||||
(activate)
|
(activate)
|
||||||
_arguments -C $help_opts \
|
_arguments -C $help_opts \
|
||||||
'--stack[activate this environment on top of the previous environment]' \
|
'--stack[activate this environment on top of the previous environment]' \
|
||||||
'*:environment:__conda_envs'
|
'*:environment:{__conda_envs; _directories}'
|
||||||
;;
|
;;
|
||||||
(deactivate)
|
(deactivate)
|
||||||
_arguments -C $help_opts \
|
_arguments -C $help_opts \
|
||||||
@@ -746,4 +747,3 @@ case $state in
|
|||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user