Completed migration from ~/devel to ~/work.
# -*- mode: sh; sh-shell-file: bash -*-
_figlet() {
local cur=${COMP_WORDS[COMP_CWORD]}
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '-f -d -c -l -r -x -t -w -p -n -D -E -C -N -s -S -k -W -o -m -v -I -L -R -X' -- "$cur") )
return 0
;;
esac
if [[ $COMP_CWORD -le 1 ]]; then
return 0
fi
local prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
-f)
local fonts=( $(cd /usr/share/figlet/; echo *.flf) )
fonts=( ${fonts[@]%.flf} )
COMPREPLY=( $(compgen -W '${fonts[@]}' -- "$cur") )
return 0 ;;
-d)
COMPREPLY=( $(compgen -d -- "$cur") )
return 0 ;;
esac
} && complete -F _figlet figlet