#compdef ansi # Save this file as _ansi in /usr/local/share/zsh/site-functions or in any # other folder in $fpath. __ansi() { local -a commands commands=( '-h:--help|help: Show version + list of command-line options]' '-n:--new-line: add new line character to output (default: false)]' "-e:--no-escape: don't escape 'ESC'-character, i.e. return the real ASCII value of `ESC` instead of `\\e` (default: false)]" "-s:--escape-style: only useful if '-e' is NOT provided: style of the `ESC`-character-escaping" 'reset:reset the font attributes' 'black:black font' 'bg-black:black background' 'red:red font' 'bg-red:red background' 'green:green font' 'bg-green:green background' 'yellow:yellow font' 'bg-yellow:yellow background' 'blue:blue font' 'bg-blue:blue background' 'purple:purple font' 'bg-purple:purple background' 'cyan:cyan font' 'bg-cyan:cyan background' 'white:white font' 'bg-white:white background' 'normal:normal font (reset)' 'bold:bold font' 'dimmed:dimmed font' 'italic:italic font' 'underline:underline font' 'blink:blink font' 'hidden:hidden font' 'strike:striked through font' 'strikethrough:striked through font' ) # allow the above options on each position # if (( CURRENT == 2 )); then _describe -t commands 'commands' commands # fi } __ansi