Skip to content

Commit

Permalink
Merge pull request #57 from jnooree/backport
Browse files Browse the repository at this point in the history
Improvements in completion usability
  • Loading branch information
esc committed Mar 12, 2024
2 parents 2b08e3e + 1f9a7f2 commit db92455
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions _conda
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ __conda_envs(){

# unmaned envs (if show-unammed).
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

_describe $describe_opts -t envs 'conda environments' envs
Expand Down Expand Up @@ -462,7 +462,7 @@ json_opts=(

env_opts=(
'(-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=(
Expand Down Expand Up @@ -703,18 +703,19 @@ case $state in
(create)
_arguments -C $help_opts \
$json_opts \
'(-n --name)'{-n,--name}'[name of environment]:environment:__conda_envs' \
$env_opts \
'(-f --file)'{-f,--file}'[environment definition]:file:_path_files' \
'(-q --quiet)'{-q,--quiet}'[]' \
;;
(export)
_arguments -C $help_opts \
'(-n --name)'{-n,--name}'[name of environment]:environment:__conda_envs' \
$env_opts \
'(-f --file)'{-f,--file}'[]:file:_path_files' \
;;
(list)
_arguments -C $help_opts \
$json_opts \
$env_opts
;;
(remove)
_arguments -C $help_opts \
Expand All @@ -727,7 +728,7 @@ case $state in
(update)
_arguments -C $help_opts \
$json_opts \
'(-n --name)'{-n,--name}'[name of environment]:environment:__conda_envs' \
$env_opts \
'(-f --file)'{-f,--file}'[environment definition]:file:_path_files' \
'(-q --quiet)'{-q,--quiet}'[]' \
;;
Expand All @@ -738,12 +739,11 @@ case $state in
(activate)
_arguments -C $help_opts \
'--stack[activate this environment on top of the previous environment]' \
'*:environment:__conda_envs'
'*:environment:{__conda_envs; _directories}'
;;
(deactivate)
_arguments -C $help_opts \
;;
esac
;;
esac

0 comments on commit db92455

Please sign in to comment.