diff options
author | Pete Travis <immanetize@fedoraproject.org> | 2014-10-01 11:33:51 -0600 |
---|---|---|
committer | Pete Travis <immanetize@fedoraproject.org> | 2014-10-01 11:33:51 -0600 |
commit | 3f6c1435a4cbdf73a65639b05898a01c0dfc21ac (patch) | |
tree | c29f3db44b106fc8b145656cd0238341551b22c0 /scratch/bash-3.1-postpatch/examples/complete/complete.freebsd | |
parent | 46c50fce0354d81d347a8055314a688fc8aa9f52 (diff) | |
download | rpmbuild-sles10-bash.tar.gz rpmbuild-sles10-bash.tar.xz rpmbuild-sles10-bash.zip |
we might need this sles10 stuff latersles10-bash
Diffstat (limited to 'scratch/bash-3.1-postpatch/examples/complete/complete.freebsd')
-rw-r--r-- | scratch/bash-3.1-postpatch/examples/complete/complete.freebsd | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scratch/bash-3.1-postpatch/examples/complete/complete.freebsd b/scratch/bash-3.1-postpatch/examples/complete/complete.freebsd new file mode 100644 index 0000000..7f6f4c2 --- /dev/null +++ b/scratch/bash-3.1-postpatch/examples/complete/complete.freebsd @@ -0,0 +1,31 @@ +#Date: Wed, 31 Jan 2001 12:53:56 -0800 +#From: Aaron Smith <aaron@mutex.org> +#To: freebsd-ports@freebsd.org +#Subject: useful bash completion function for pkg commands +#Message-ID: <20010131125356.G52003@gelatinous.com> + +#hi all. i just wanted to share this bash completion function i wrote that +#completes package names for pkg_info and pkg_delete. i find this a great +#help when dealing with port management. programmed completion requires +#bash-2.04. + +_pkg_func () +{ + local cur + + cur=${COMP_WORDS[COMP_CWORD]} + + if [[ $cur == '-' ]]; then + if [[ ${COMP_WORDS[0]} == 'pkg_info' ]]; then + COMPREPLY=(-a -c -d -D -i -k -r -R -p -L -q -I -m -v -e -l) + return 0; + elif [[ ${COMP_WORDS[0]} == 'pkg_delete' ]]; then + COMPREPLY=(-v -D -d -n -f -p) + return 0; + fi + fi + + COMPREPLY=( $(compgen -d /var/db/pkg/$cur | sed sN/var/db/pkg/NNg) ) + return 0 +} +complete -F _pkg_func pkg_delete pkg_info |