1function __fish_print_figlet_fonts
2    set -l dir (figlet -I 2)
3    set -l files $dir/*.flf $dir/*.tlf
4
5    printf '%s\tFont\n' (string replace -r '.*/([^/]+)\.[ft]lf' '$1' -- $files)
6end
7
8complete -c figlet -s f -d "Select font" -x -a "(__fish_print_figlet_fonts)"
9complete -c figlet -s d -d "Change font directory"
10complete -c figlet -s c -d "Center output horizontally"
11complete -c figlet -s l -d "Make output flush-left"
12complete -c figlet -s r -d "Make output flush-right"
13complete -c figlet -s x -d "Set justification according to text direction"
14complete -c figlet -s t -d "Set output to terminal width"
15complete -c figlet -s w -d "Set output width"
16complete -c figlet -s p -d "Put FIGlet into `paragraph mode`"
17complete -c figlet -s n -d "Put FIGlet back to normal"
18complete -c figlet -s D -d "Switch to German (ISO 646-DE) character set"
19complete -c figlet -s E -d "Turns off German character set processing"
20complete -c figlet -s C -d "Add given control file" -k -a "(__fish_complete_suffix .flc)" -x
21complete -c figlet -s N -d "Clear control file list"
22complete -c figlet -s s -d "Cause `smushing`"
23complete -c figlet -s S -d "Cause `smushing`"
24complete -c figlet -s k -d "Cause `kerning`"
25complete -c figlet -s W -d "Makes FIGlet all FIGcharacters at full width"
26complete -c figlet -s o -d "Cause `overlapped`"
27complete -c figlet -s m -d "Specify layout mode between 1 and 63"
28complete -c figlet -s v -d "Print version and copyright"
29complete -c figlet -s I -d "Print information given infocode" -x -a "0\tVersion\ and\ copyright 1\tVersion\ \(integer\) 2\tDefault\ font\ directory 3\tFont 4\tOutput\ width 5\tSupported\ font\ format"
30complete -c figlet -s L -d "Print left-to-right"
31complete -c figlet -s R -d "Print right-to-left"
32complete -c figlet -s X -d "Print with default text direction"
33