diff options
author | 2007-03-05 09:06:00 +0000 | |
---|---|---|
committer | 2007-03-05 09:06:00 +0000 | |
commit | 510e8f53b27eccb0447cadeede401d350bd65bfc (patch) | |
tree | 5f7361eb3bc7f67ae5cea814552937f61f208392 | |
parent | 7cdcbac2cb7a621a71b4cdef573857ad43e9e15d (diff) | |
download | paludis-510e8f53b27eccb0447cadeede401d350bd65bfc.tar.gz paludis-510e8f53b27eccb0447cadeede401d350bd65bfc.tar.xz |
Add a basic bashcomp script for contrarius.
-rw-r--r-- | bash-completion/Makefile.am | 2 | ||||
-rw-r--r-- | bash-completion/contrarius | 68 |
2 files changed, 69 insertions, 1 deletions
diff --git a/bash-completion/Makefile.am b/bash-completion/Makefile.am index 1a28526d9..8a791e2bc 100644 --- a/bash-completion/Makefile.am +++ b/bash-completion/Makefile.am @@ -1,5 +1,5 @@ MAINTAINERCLEANFILES = Makefile.in -noinst_DATA = paludis adjutrix qualudis +noinst_DATA = paludis adjutrix qualudis contrarius EXTRA_DIST = $(noinst_DATA) built-sources : $(BUILT_SOURCES) diff --git a/bash-completion/contrarius b/bash-completion/contrarius new file mode 100644 index 000000000..86f94a5fd --- /dev/null +++ b/bash-completion/contrarius @@ -0,0 +1,68 @@ +# Bash completion function for contrarius +# 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. + +_contrarius() { + local cur prev opts + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + opts="--version -V \ + --help -h \ + --fetch -f \ + --pretend -p \ + --show-reasons \ + --stage -s \ + --target -t \ + --headers -H \ + --always-rebuild -r \ + --debug-build \ + --binutils-name \ + --binutils-version \ + --gcc-name \ + --gcc-version \ + --headers-name \ + --headers-version \ + --libc-name \ + --libc-version \ + --verbose -v \ + --log-level -L \ + --no-colour -C \ + --nocolor \ + --resume-command-template" + + case "${cur}" in + -*) + COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) + return 0 + ;; + *) + case "${prev}" in + ## Enum operators + --log-level|-L) + COMPREPLY=($(compgen -W "debug qa warning silent" -- "${cur}")) + return 0 + ;; + + --show-reasons) + COMPREPLY=($(compgen -W "none summary full" -- "${cur}")) + return 0 + ;; + --stage|-s) + COMPREPLY=($(compgen -W "binutils minimal headers libc full" -- "${cur}")) + return 0 + ;; + --debug-build) + COMPREPLY=($(compgen -W "none split internal" -- "${cur}")) + return 0 + ;; + + esac + ;; + esac +} +complete -F _contrarius contrarius |