Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements in completion usability #57

Merged
merged 3 commits into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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