aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-07 11:17:19 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-07 11:17:19 +0000
commit6f61a1aacd67ee4e6dcd21a27f6ab72f95f1df8b (patch)
tree32349d908052934c91fb99acd75e1f8d47cdcf26
parent0d6466d4add5e83f765f6561b33d601a46571a33 (diff)
downloadpaludis-6f61a1aacd67ee4e6dcd21a27f6ab72f95f1df8b.tar.gz
paludis-6f61a1aacd67ee4e6dcd21a27f6ab72f95f1df8b.tar.xz
Update zsh completion. From Baptiste Daroussin. Fixes: ticket:81
-rw-r--r--zsh-completion/Makefile.am2
-rw-r--r--zsh-completion/_inquisitio36
-rw-r--r--zsh-completion/_paludis9
3 files changed, 43 insertions, 4 deletions
diff --git a/zsh-completion/Makefile.am b/zsh-completion/Makefile.am
index 3f78d65..14e6ac3 100644
--- a/zsh-completion/Makefile.am
+++ b/zsh-completion/Makefile.am
@@ -1,5 +1,5 @@
MAINTAINERCLEANFILES = Makefile.in
-noinst_DATA = _paludis _adjutrix _paludis_packages
+noinst_DATA = _paludis _adjutrix _paludis_packages _inquisitio
EXTRA_DIST = $(noinst_DATA)
built-sources : $(BUILT_SOURCES)
diff --git a/zsh-completion/_inquisitio b/zsh-completion/_inquisitio
new file mode 100644
index 0000000..725051b
--- /dev/null
+++ b/zsh-completion/_inquisitio
@@ -0,0 +1,36 @@
+#compdef inquisitio
+
+# vim: set et sw=4 sts=4 ts=4 ft=zsh :
+# ZSH completion for inquisitio
+# Written by Baptiste Daroussin <baptux at free.fr>
+
+_inquisitio() {
+ local actions general_options search_options action_options
+ actions=(
+ --search -s
+ --version -V
+ --help -h
+ )
+ action_options=(
+ "($actions)"{--search,-s}"[Search for a package]"
+ "(: -)"{--version,-V}"[Display program version]"
+ "(: -)"{--help,-h}"[Display program help]"
+ )
+ general_options=(
+ "--log-level[Specify the log level]:log level:((debug\:Show\ debug\ output qa\:Show\ QA\ messages\ and\ warnings\ only warning\:Show\ warnings\ only silent\:Suppress\ all\ log\ messages))"
+ "(--no-colour --no-color)"{--no-colour,--no-color}"[Do not use colour]"
+ "(--repository-dir -D)"{--repository-dir,-D}"[Where to find the repository]:repository:_files -/"
+ )
+ search_options=(
+ "(--matcher -m)"{--matcher,-m}"[Which match algorithm to use]:which:((text\:Simple\ text\ match pcre\:Regular\ expression\ match\ using\ pcre))"
+ "(--extractors -e)"{--extractors,-e}"[Which extractors to use]:which:((description\:Match\ against\ description name\:Match\ against\ package\ name homepage\:Match\ against\ homepage))"
+ "--repository[Matches with this repository name only]:repository:_paludis_packages repositories"
+ "--repository-format[Matches with this repository format only]:format:_paludis_packages repository-formats"
+ "--category[Matches with this category name only]:category:_paludis_packages categories"
+ "--package[Matches with this package name only]:package:_paludis_packages available"
+ )
+ _arguments -s \
+ $general_options[@] $search_options[@] $action_options[@] && return 0
+}
+
+_inquisitio "$@"
diff --git a/zsh-completion/_paludis b/zsh-completion/_paludis
index 3bdafec..49c9bae 100644
--- a/zsh-completion/_paludis
+++ b/zsh-completion/_paludis
@@ -6,8 +6,10 @@
_paludis() {
local actions action_args query_args general_args deplist_args install_uninstall_args list_args lists owner_args
- actions=( --query --install -i --uninstall -u --sync -s --report --contents -k --owner -o --version -V --info -I --help -h \
- --has-version --best-version --environnement-variable --list-repositories --list-categories --list-packages --list-sets --list-sync-protocols --list-repository-formats --list-dep-tag-categories --regenerate-installed-cache --update-news --regenerate-installable-cache)
+ actions=( --query --install -i --uninstall -u --sync -s --report --contents -k --owner -o --version -V --info -I --help -h
+ --has-version --best-version --environnement-variable --list-repositories --list-categories --list-packages --list-sets
+ --list-sync-protocols --list-repository-formats --list-dep-tag-categories --regenerate-installed-cache --update-news
+ --regenerate-installable-cache --config)
query_args=(
"(--show-deps -D)"{--show-deps,-D}"[Show dependencies]"
@@ -72,6 +74,7 @@ _paludis() {
"(: -)--update-news[Regenerate news.unread files]"
"(: -)--regenerate-installed-cache[Regenerate (non-metadata) cache for installed repositories]"
"(: -)--regenerate-installable-cache[Regenerate (non-metadata) cache for installable repositories]"
+ "(: -)--config[Run post-install configuration for a package]"
)
owner_args=(
"--full-match[Match whole filename]"
@@ -96,7 +99,7 @@ _paludis() {
"--dl-new-slots[When to pull in new slots (works with --dl-upgrade)]:When:(always as-needed)"
)
#dispatch
- if (( $words[(I)(--uninstall|-[[:alpha:]]#u[[:alpha:]]#)] )) ; then
+ if (( $words[(I)(--(uninstall|config)|-[[:alpha:]]#u[[:alpha:]]#)] )) ; then
_arguments -s \
$general_args[@] $deplist_args[@] $install_uninstall_args[@] $uninstall_args[@] \
"*:installed package:_paludis_packages installed" && return 0