mirror of
https://github.com/conda-incubator/conda-zsh-completion.git
synced 2026-03-04 06:14:59 +08:00
initial port from the git-annex zsh completion
This commit is contained in:
95
_conda
Normal file
95
_conda
Normal file
@@ -0,0 +1,95 @@
|
||||
#compdef conda
|
||||
#description:managing files while ignoring their content
|
||||
|
||||
# ZSH Completion for git-annex (http://git-annex.branchable.com/)
|
||||
#
|
||||
# This completion was written for git-annex version: 3.20111122~bpo60+2
|
||||
#
|
||||
# Note that this completion is still very much early alpha work in progress.
|
||||
#
|
||||
# This completion depends on Python for a jason parser, sorry. Unfortunately
|
||||
# there is no such thing in zsh (yet).
|
||||
#
|
||||
# Skeleton implementation by Frank Terbeck <ft@bewatermyfriend.org>
|
||||
# Blanks filled in by Valentin Haenel <valentin.haenel@gmx.de>
|
||||
# Licence: WTFPL (http://sam.zoy.org/wtfpl/)
|
||||
#
|
||||
# To use this completion drop it somewhere in you $fpath, e.g.:
|
||||
#
|
||||
# $ git clone $CLONEURL
|
||||
# $ fpath+=$PWD/git-annex-zsh-completion
|
||||
# $ compinit git-annex
|
||||
#
|
||||
# TODO
|
||||
# ----
|
||||
#
|
||||
# * 'git annex add' to only complete files not in annex
|
||||
#
|
||||
|
||||
local state line context
|
||||
local -A opt_args
|
||||
|
||||
|
||||
|
||||
|
||||
local -a arguments
|
||||
arguments=(
|
||||
'(-h --help)'{-h,--help}'[show this help message and exit]'
|
||||
'(-v --version)'{-v,--version}"[show program's version number and exit]"
|
||||
)
|
||||
|
||||
_arguments -C \
|
||||
': :->command' \
|
||||
'*:: :->subcmd'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
local -a package
|
||||
local -a maint
|
||||
local -a environment
|
||||
local -a help
|
||||
local -a config
|
||||
local -a special
|
||||
package=(
|
||||
search:'Search for packages and display their information.'
|
||||
install:'Install a list of packages into a specified conda environment.'
|
||||
)
|
||||
maint=(
|
||||
update:'Update conda packages.'
|
||||
clean:'Remove unused packages and caches.'
|
||||
)
|
||||
environment=(
|
||||
info:'Display information about current conda install.'
|
||||
create:'Create a new conda environment from a list of specified packages.'
|
||||
list:'List linked packages in a conda environment.'
|
||||
remove:'Remove a list of packages from a specified conda environment.'
|
||||
)
|
||||
help=(
|
||||
help:'Displays a list of available conda commands and their help strings.'
|
||||
)
|
||||
config=(
|
||||
config:'Modify configuration values in .condarc.'
|
||||
)
|
||||
special=(
|
||||
run:'Launches an application installed with Conda.'
|
||||
init:'Initialize conda into a regular environment. (DEPRECATED)'
|
||||
package:'Low-level conda package utility. (EXPERIMENTAL)'
|
||||
bundle:'Create or extract a "bundle package" (EXPERIMENTAL)'
|
||||
)
|
||||
_describe -t package_commands "package commands" package
|
||||
_describe -t maint_commands "maint commands" maint
|
||||
_describe -t environment_commands "environment commands" environment
|
||||
_describe -t help_commands "help commands" help
|
||||
_describe -t config_commands "config commands" config
|
||||
_describe -t special_commands "special commands" special
|
||||
;;
|
||||
(subcmd)
|
||||
case ${line[1]} in
|
||||
(*)
|
||||
# _arguments -C $arguments
|
||||
_path_files
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user