summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/bash-completion/cowsay.bashcomp
diff options
context:
space:
mode:
authorMichael Hanson <hansonorders@verison.net>2010-03-19 00:08:12 (GMT)
committerMichael Hanson <hansonorders@verison.net>2010-03-19 00:08:12 (GMT)
commit0c810798e72af9cd3cb88de1b79b2a901bad3963 (patch)
tree3f6ef2600e769c41f9da475ea357895c134cf747 /abs/extra-testing/bash-completion/cowsay.bashcomp
parent896e8723af0a99e741d6d767c13b4aa52f20820c (diff)
parent948970dc8ce2e250324747bf0499c78acfd78912 (diff)
downloadlinhes_pkgbuild-0c810798e72af9cd3cb88de1b79b2a901bad3963.zip
linhes_pkgbuild-0c810798e72af9cd3cb88de1b79b2a901bad3963.tar.gz
linhes_pkgbuild-0c810798e72af9cd3cb88de1b79b2a901bad3963.tar.bz2
Merge branch 'master' of mihanson@knoppmyth.net:LinHES-PKGBUILD
Diffstat (limited to 'abs/extra-testing/bash-completion/cowsay.bashcomp')
-rw-r--r--abs/extra-testing/bash-completion/cowsay.bashcomp34
1 files changed, 34 insertions, 0 deletions
diff --git a/abs/extra-testing/bash-completion/cowsay.bashcomp b/abs/extra-testing/bash-completion/cowsay.bashcomp
new file mode 100644
index 0000000..77d8be9
--- /dev/null
+++ b/abs/extra-testing/bash-completion/cowsay.bashcomp
@@ -0,0 +1,34 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/games-misc/cowsay/files/cowsay.bashcomp,v 1.1 2005/02/06 14:37:54 ka0ttic Exp $
+
+# bash command-line completion for cowsay
+# Author: Aaron Walker <ka0ttic@gentoo.org>
+# Modified by: Michal Bentkowski <mr.ecik at gmail.com>
+
+_cowsay() {
+ local cur prev opts x
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ opts="-e -f -h -l -n -T -W -b -d -g -p -s -t -w -y"
+
+ if [[ "${cur}" == -* || ${COMP_CWORD} -eq 1 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ fi
+
+ case "${prev}" in
+ -f)
+ COMPREPLY=( $( command ls /usr/share/cowsay| \
+ sed -ne 's/^\('$cur'.*\)\.cow$/\1/p') )
+ return 0
+ ;;
+ -[eTW])
+ COMPREPLY=()
+ ;;
+ esac
+}
+complete -o filenames -F _cowsay cowsay cowthink
+
+# vim: set ft=sh tw=80 sw=4 et :