1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
# (C) 2010 magicant
# Completion script for the "unset" built-in command.
function completion/unset {
typeset OPTIONS ARGOPT PREFIX
OPTIONS=( #>#
"f --functions; remove functions"
"v --variables; remove variables"
"--help"
) #<#
command -f completion//parseoptions -es
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(*)
typeset i=1 func=false
while [ $i -le ${WORDS[#]} ]; do
case ${WORDS[i++]} in
(-f|--functions) func=true ;;
(-v|--variables) func=false ;;
(--) break ;;
esac
done
if $func; then
complete --function
else
complete -v
fi
;;
esac
}
# vim: set ft=sh ts=8 sts=8 sw=8 et:
|