Add completion for figlet.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.bash_completion.d/figlet Sun Feb 12 14:21:32 2017 +0200
@@ -0,0 +1,25 @@
+# -*- 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