aboutsummaryrefslogtreecommitdiff
path: root/0.8.0/bash-completion/paludis
diff options
context:
space:
mode:
Diffstat (limited to '0.8.0/bash-completion/paludis')
-rw-r--r--0.8.0/bash-completion/paludis108
1 files changed, 108 insertions, 0 deletions
diff --git a/0.8.0/bash-completion/paludis b/0.8.0/bash-completion/paludis
new file mode 100644
index 0000000..971ea54
--- /dev/null
+++ b/0.8.0/bash-completion/paludis
@@ -0,0 +1,108 @@
+# Bash completion function for paludis
+# Written by Mike Kelly
+# vim: set et sw=4 sts=4 ts=4 ft=sh :
+
+# NOTE: This is still a work in progress, don't expect it to work well or
+# properly right now.
+
+_paludis() {
+ local cur prev opts
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ opts="--query -q \
+ --install -i \
+ --uninstall -u \
+ --sync -s \
+ --contents -k \
+ --owner -o \
+ --version -V \
+ --info -I \
+ --help -h \
+ --has-version \
+ --best-version \
+ --environment-variable \
+ --configuration-variable \
+ --list-repositories \
+ --list-categories \
+ --list-packages \
+ --list-sets \
+ --list-sync-protocols \
+ --list-repository-formats \
+ --list-dep-tag-categories \
+ --list-vulnerabilities \
+ --update-news \
+ --log-level \
+ --no-colour -C \
+ --no-color \
+ --config-suffix -c \
+ --show-slot -S \
+ --show-deps -D \
+ --show-metadata -M \
+ --pretend -p \
+ --preserve-world -1 \
+ --no-config-protection \
+ --fetch -f \
+ --dl-rdepend-post \
+ --dl-drop-self-circular \
+ --dl-drop-circular \
+ --dl-drop-all -0 \
+ --dl-ignore-installed -e \
+ --dl-no-recursive-deps \
+ --dl-max-stack-depth \
+ --dl-no-unnecessary-upgrades -U \
+ --repository \
+ --category \
+ --package \
+ --set \
+ --full-match"
+
+ case "${cur}" in
+ -*)
+ COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
+ return 0
+ ;;
+ *)
+ case "${prev}" in
+ ## Enum operators
+ --log-level)
+ COMPREPLY=($(compgen -W "debug qa warning silent" -- "${cur}"))
+ return 0
+ ;;
+ --dl-rdepend-post)
+ COMPREPLY=($(compgen -W "always never as-needed" -- "${cur}"))
+ return 0
+ ;;
+ ## list specifiers
+ --repository)
+ COMPREPLY=($(compgen -W "`paludis --no-colour --list-repositories --log-level silent |grep \"^*\" |cut -d\" \" -f2-`" -- "${cur}"))
+ return 0
+ ;;
+ --category)
+ COMPREPLY=($(compgen -W "`paludis --no-colour --list-categories --log-level silent |grep \"^*\" |cut -d\" \" -f2-`" -- "${cur}"))
+ return 0
+ ;;
+ --package)
+ COMPREPLY=($(compgen -W "`paludis --no-colour --list-packages --log-level silent |grep \"^*\" |cut -d\" \" -f2-`" -- "${cur}"))
+ return 0
+ ;;
+ --set)
+ COMPREPLY=($(compgen -W "`paludis --no-colour --list-sets --log-level silent |grep \"^\\*\" |cut -d\" \" -f2-`" -- "${cur}"))
+ return 0
+ ;;
+ --owner)
+ COMPREPLY=($(compgen -o filenames -- "${cur}"))
+ return 0
+ ;;
+ *)
+ # Do package name completion, etc
+ # For now, just complete on set names
+ COMPREPLY=($(compgen -W "`paludis --no-colour --list-sets --log-level silent |grep \"^*\" |cut -d\" \" -f2-`" -- "${cur}"))
+ return 0
+ ;;
+ esac
+ ;;
+ esac
+}
+complete -F _paludis paludis