aboutsummaryrefslogtreecommitdiff
path: root/zsh-completion/_paludis
diff options
context:
space:
mode:
Diffstat (limited to 'zsh-completion/_paludis')
-rw-r--r--zsh-completion/_paludis106
1 files changed, 106 insertions, 0 deletions
diff --git a/zsh-completion/_paludis b/zsh-completion/_paludis
new file mode 100644
index 000000000..9f057ef24
--- /dev/null
+++ b/zsh-completion/_paludis
@@ -0,0 +1,106 @@
+#compdef paludis
+
+# vim: set et sw=4 sts=4 ts=4 ft=zsh :
+# ZSH completion for adjutrix
+# Written by Baptiste Daroussin <baptux at free.fr>
+
+_paludis() {
+ local actions action_args query_args general_args deplist_args install_uninstall_args list_args lists
+ 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)
+
+ query_args=(
+ '(--show-deps -D)'{--show-deps,-D}"[Show dependencies]"
+ '(--show-metadata -M)'{--show-metadata,-M}"[Show raw metadata]"
+ )
+
+ install_uninstall_args=(
+ '(--pretend -p)'{--pretend,-p}"[Pretend only]"
+ '(--preserve-world -1)'{--preserve-world,-1}"[Don t modify the world file]"
+ '--no-config-protection[Disable config file protection (dangerous)]'
+ '--debug-build[What to do with debug information]:Debug Build:(( none\:Discard\ debug\ information split\:Split\ debug\ information internal\:Keep\ debug\ information\ with\ binaries ))'
+ '(--fetch -f)'{--fetch,-f}'[Only fetch sources; don t install anything]'
+ '--show-install-reasons[Show why packages are being installed]:Verbosity:((none\:Don\ t\ show\ any\ information summary\:Show\ a\ summary full\:Show\ full\ output))'
+ '--with-unused-dependencies[Also uninstall any dependencies of the target that are no longer used]'
+ '--with-dependencies[Also uninstall packages that depend upon the target]'
+ )
+ list_args=(
+ '--repository[Matches with this repository name only]:repository:_paludis_packages repositories'
+ '--category[Matches with this category name only]:category:_paludis_packages category'
+ '--package[Matches with this package name only]:package:_paludis_packages available'
+ '--set[Matches with this package set name only]:set:_paluldis_packages set'
+ )
+
+ lists=(
+ '(: -)--list-repositories[List available repositories]'
+ '(: -)--list-categories[List available categories]'
+ '(: -)--list-packages[List available packages]'
+ '(: -)--list-sets[List available package sets]'
+ '(: -)--list-sync-protocols[List available sync protocols]'
+ '(: -)--list-repository-formats[List available repository formats]'
+ '(: -)--list-dep-tag-categories[List known dep tag categories]'
+ )
+ general_args=(
+ '--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]"
+ '(--config-suffix -c)'{-c,--config-suffix}"[Config directory suffix]"
+ )
+
+ action_args=(
+ "($actions)"{-q,--query}"[Query for package information]"
+ "($actions)"{-i,--install}"[Install one or more packages]"
+ "($actions)"{-u,--uninstall}"[Uninstall one or more packages]"
+ "(: -)"{--sync,-s}"[Sync all or specified repositories]:repository:_paludis_packages repositories"
+ "($actions)--uninstall-unused[Uninstall unused packages]"
+ "(: -)"{--report,-r}"[Report the current state of the system]"
+ "(: -)"{--contents,-k}"[Display contents of a package]:package:_paludis_packages installed"
+ "(: -)"{--owner,-o}"[Display the owner of a file]:File:_files"
+ "(: -)"{--version,-V}"[Display program version]"
+ "(: -)"{--info,-I}"[Display program version and system information]"
+ "(: -)"{--help,-h}"[Display program help]"
+ "(: -)--has-version[Check whether the specified atom is installed]:package:_paludis_packages available"
+ "(: -)--best-version[Display the best version of the specified atom]:package _paludis_packages available"
+ "(: -)--environment-variable[Display the value of an environment variable for a particular package]:package:_paludis_packages available"
+ "(: -)--configuration-variable[Display the value of a configuration variable for a particular repository]:_paludis_packages repositories"
+ "(: -)--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]"
+ )
+ deplist_args=(
+ "--dl-reinstall[When to reinstall packages]:When:(never always if-use-changed)"
+ "--dl-reinstall-scm[When to reinstall scm packages]:When:(never always daily weekly)"
+ "--dl-upgrade[When to upgrade packages]:When:(always as-needed)"
+ "--dl-installed-deps-pre[How to handle pre dependencies for installed packages]:How:(pre pre-or-post post try-post discard)"
+ "--dl-installed-deps-runtime[How to handle runtime dependencies for installed packages]:How:(pre pre-or-post post try-post discard)"
+ "--dl-installed-deps-post[How to handle post dependencies for installed packages]:How:(pre pre-or-post post try-post discard)"
+ "--dl-uninstalled-deps-pre[How to handle pre dependencies for uninstalled packages]:How:(pre pre-or-post post try-post discard)"
+ "--dl-uninstalled-deps-post[How to handle post dependencies for uninstalled packages]:How:(pre pre-or-post post try-post discard)"
+ "--dl-circular[How to handle circular dependencies]:How:(error discard)"
+ "--dl-fall-back[When to fall back to installed packages]:When:(as-needed-except-targets as-needed never)"
+ )
+ #dispatch
+ if (( $words[(I)(--(uninstall)|-[[:alpha:]]#(u)[[:alpha:]]#)] )) ; then
+ _arguments -s \
+ $general_args[@] $deplist_args[@] $install_uninstall_args[@] \
+ "*:installed package:_paludis_packages installed" && return 0
+ elif (( $words[(I)--uninstall-unused] )) ; then
+ _arguments -s \
+ $deplist_args[@] $install_uninstall_args[@] && return 0
+ elif (( $words[(I)(--(install)|-[[:alpha:]]#(i)[[:alpha:]]#)] )) ;then
+ _arguments -s \
+ $general_args[@] $deplist_args[@] $install_uninstall_args[@] \
+ "*:available packages:_paludis_packages available" && return 0
+ elif (( $words[(I)(--(query)|-[[:alpha:]]#(q)[[:alpha:]]#)] )) ;then
+ _arguments -s \
+ $general_args[@] $query_args[@]\
+ "*:available packages:_paludis_packages available" && return 0
+ elif (( $words[(I)--(repository|package|category|set)] ));then
+ _arguments \
+ $lists[@] && reruen 0
+ else
+ _arguments -s \
+ $general_args[@] $deplist_args[@] $list_args[@] $lists[@] $install_uninstall_args[@] "$action_args[@]" && return 0
+ fi
+}
+
+_paludis "$@"