mirror of
https://github.com/conda-incubator/conda-zsh-completion.git
synced 2026-03-04 14:24:59 +08:00
refactor install opts
This commit is contained in:
48
_conda
48
_conda
@@ -78,6 +78,29 @@ _arguments -C $opts \
|
||||
': :->command' \
|
||||
'*:: :->subcmd'
|
||||
|
||||
|
||||
install_opts=(
|
||||
'(-y --yes)'{-y,--yes}'[do not ask for confirmation]' \
|
||||
'--dry-run[only display what would have been done]' \
|
||||
'(-f --force)'{-f,--force}'[force install]' \
|
||||
'--file[read package versions from file]:file:_path_files' \
|
||||
'--unknown[use index metadata from the local package cache]' \
|
||||
'--no-deps[do not install dependencies]' \
|
||||
'(-m --mkdir)'{-m,--mkdir}'[create prefix directory if necessary]' \
|
||||
'--use-index-cache[use cache of channel index files]' \
|
||||
'--use-local[use locally built packages]' \
|
||||
'--offline[offline mode, don''t connect to internet]' \
|
||||
'--no-pin[ignore pinned file]' \
|
||||
'(-c --channel)'{-c,--channel}'[additional channel to search for packages]:channel:__conda_channels'\
|
||||
'--override-channels [do not search default or .condarc channels]' \
|
||||
'(-n --name=)'{-n,--name=}'[install into given conda environment]:environment:__conda_envs' \
|
||||
'(-p --prefix)'{-p,--prefix}'[full path to environment prefix]:path:_path_files' \
|
||||
'(-q --quiet)'{-q,--quiet}'[do not display progress bar]'\
|
||||
'--copy[Install all packages using copies instead of hard- or soft-linking]' \
|
||||
'--alt-hint[Use an alternate algorithm to generate an unsatisfiable hint]' \
|
||||
'--json[report all output as json.]' \
|
||||
)
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
__conda_commands
|
||||
@@ -85,27 +108,9 @@ case $state in
|
||||
(subcmd)
|
||||
case ${line[1]} in
|
||||
(install)
|
||||
_arguments -C '(-n --name=)'{-n,--name=}'[install into given conda environment]:environment:__conda_envs' \
|
||||
'(-h --help)'{-h,--help}'[show the help message and exit]' \
|
||||
_arguments -C '(-h --help)'{-h,--help}'[show the help message and exit]' \
|
||||
$install_opts \
|
||||
'--revision[revert to the specified revision]:revision' \
|
||||
'(-y --yes)'{-y,--yes}'[do not ask for confirmation]' \
|
||||
'--dry-run[only display what would have been done]' \
|
||||
'(-f --force)'{-f,--force}'[force install]' \
|
||||
'--file[read package versions from file]:file:_path_files' \
|
||||
'--unknown[use index metadata from the local package cache]' \
|
||||
'--no-deps[do not install dependencies]' \
|
||||
'(-m --mkdir)'{-m,--mkdir}'[create prefix directory if necessary]' \
|
||||
'--use-index-cache[use cache of channel index files]' \
|
||||
'--use-local[use locally built packages]' \
|
||||
'--offline[offline mode, don''t connect to internet]' \
|
||||
'--no-pin[ignore pinned file]' \
|
||||
'(-c --channel)'{-c,--channel}'[additional channel to search for packages]:channel:__conda_channels'\
|
||||
'--override-channels [do not search default or .condarc channels]' \
|
||||
'(-p --prefix)'{-p,--prefix}'[full path to environment prefix]:path:_path_files' \
|
||||
'(-q --quiet)'{-q,--quiet}'[do not display progress bar]'\
|
||||
'--copy[Install all packages using copies instead of hard- or soft-linking]' \
|
||||
'--alt-hint[Use an alternate algorithm to generate an unsatisfiable hint]' \
|
||||
'--json[report all output as json.]' \
|
||||
'*:packages:__conda_packages_search' \
|
||||
;;
|
||||
(list)
|
||||
@@ -119,6 +124,9 @@ case $state in
|
||||
'--no-pip[Do not include pip-only installed packages]' \
|
||||
'*:regex:' \
|
||||
;;
|
||||
(update)
|
||||
_arguments -C $install_opts
|
||||
;;
|
||||
(help)
|
||||
_arguments -C '(-h --help)'{-h,--help}'[show the help message and exit]' \
|
||||
'*:commands:__conda_commands' \
|
||||
|
||||
Reference in New Issue
Block a user