aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Lasse Brun <bruners@gmail.com> 2013-06-24 23:06:19 +0200
committerAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2013-06-27 16:52:02 +0200
commit7969f3e50f6c6b89e91d6e7284e21e4fc5a15238 (patch)
tree04438e59ea655867ac4b56486f4659a57eb0418a
parent3f2aca298c28e50745926a96758f4641dc73cf51 (diff)
downloadpaludis-7969f3e50f6c6b89e91d6e7284e21e4fc5a15238.tar.gz
paludis-7969f3e50f6c6b89e91d6e7284e21e4fc5a15238.tar.xz
zsh-completion: categories and repository-formats
New function _cave_categories New function _cave_repository_formats Completion for repositores and categories in _cave_cmd_print_packages Completion for repostiory-formats in _cave_print-repositories
-rw-r--r--zsh-completion/_cave20
1 files changed, 17 insertions, 3 deletions
diff --git a/zsh-completion/_cave b/zsh-completion/_cave
index d8896ee..ff78b60 100644
--- a/zsh-completion/_cave
+++ b/zsh-completion/_cave
@@ -596,8 +596,8 @@ _cave_cmd_print-packages()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
- '*'{--repository,-r}'[Show only names in the specified repository]' \
- '*'{--category,-c}'[Show only names in the specified category]'
+ '*'{--repository,-r}'[Show only names in the specified repository]:repository name:_cave_repositories' \
+ '*'{--category,-c}'[Show only names in the specified category]:category name:_cave_categories'
}
(( ${+functions[_cave_cmd_print-repositories]} )) ||
@@ -605,7 +605,7 @@ _cave_cmd_print-repositories()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
- '--format[Show only repositories of a specific format]:repository format: '
+ '--format[Show only repositories of a specific format]:repository format:_cave_repository_formats'
}
(( ${+functions[_cave_cmd_print-repository-formats]} )) ||
@@ -900,6 +900,13 @@ _cave_algorithms() {
_describe -t algorithm 'algorithm' _cave_algorithms
}
+(( ${+functions[_cave_categories]} )) ||
+_cave_categories() {
+ local -a _cave_categories
+ _cave_categories=( $(cave print-categories) )
+ _describe -t category 'category' _cave_categories
+}
+
(( ${+functions[_cave_packages]} )) ||
_cave_packages() {
:
@@ -912,6 +919,13 @@ _cave_protocols() {
_describe -t protocol 'protocol' _cave_protocols
}
+(( ${+functions[_cave_repository_formats]} )) ||
+_cave_repository_formats () {
+ local -a _cave_repository_formats
+ _cave_repository_formats=( $(cave print-repository-formats) )
+ _describe -t format 'print-repository-format' _cave_repository_formats
+}
+
(( ${+functions[_cave_repositories]} )) ||
_cave_repositories() {
local -a _cave_repositories