| 1 |
#compdef jp2a |
| 2 |
|
| 3 |
_arguments -C \ |
| 4 |
'--red=[Set RGB to grayscale conversion weight, default is 0.2989]::' \ |
| 5 |
'--green=[Set RGB to grayscale conversion weight, default is 0.5866]::' \ |
| 6 |
'--blue=[Set RGB to grayscale conversion weight, default is 0.1145]::' \ |
| 7 |
'-[Read images from standard input.]' \ |
| 8 |
'(-b --border)'{-b,--border}'[Print a border around the output image.]' \ |
| 9 |
'--chars=[Select character palette used to paint the image. Leftmost character corresponds to black pixel, right-most to white. Minimum two characters must be specified.]':: \ |
| 10 |
'--clear[Clears screen before drawing each output image.]' \ |
| 11 |
'--colors[Use true colors or, if true color is not supported, ANSI in output.]' \ |
| 12 |
'--color-depth=[Use a specific color-depth for terminal output. Valid values are: 4 (for ANSI), 8 (for 256 color palette) and 24 (for truecolor or 24-bit color).]:colordepth:(4 8 24)' \ |
| 13 |
'(-d --debug)'{-d,--debug}'[Print additional debug information.]' \ |
| 14 |
'--edge-threshold=[Image gradient above which to shade lines and edges with directional glyphs (such as -/|\).]' \ |
| 15 |
'--edges-only[Only draw edges - make sure you use it with the edge-threshold option so edges are drawn.]' \ |
| 16 |
"(--fill --html-fill)--fill[When used with --color and/or --htmlls or --xhtml, color each character's background.]" \ |
| 17 |
'(-x --flipx)'{-x,--flipx}'[Flip image in X direction.]' \ |
| 18 |
'(-y --flipy)'{-y,--flipy}'[Flip image in Y direction.]' \ |
| 19 |
'(-f --term-fit)'{-f,--term-fit}'[Use the largest image dimension that fits in your terminal display with correct aspect ratio.]' \ |
| 20 |
'--term-height[Use terminal display height.]' \ |
| 21 |
'--term-width[Use terminal display width.]' \ |
| 22 |
'(-z --term-zoom)'{-z,--term-zoom}'[Use terminal display dimension for output.]' \ |
| 23 |
'(-c --term-center)'{-c,--term-center}'[Center image in terminal.]' \ |
| 24 |
'--grayscale[Convert image to grayscale when using --htmlls or --xhtml or --colors.]' \ |
| 25 |
'--height=[Set output height, calculate width from aspect ratio.]':: \ |
| 26 |
'(- *)'{-h,--help}'[Print program help.]' \ |
| 27 |
'--htmlls[Produce HTML (Living Standard) output.]' \ |
| 28 |
'--html[Produce strict XHTML 1.0 output (will produce HTML output from version 2.0.0 onward).]' \ |
| 29 |
'--xhtml[Produce strict XHTML 1.0 output.]' \ |
| 30 |
'(--fill --html-fill)--html-fill[Same as --fill (will be phased out).]' \ |
| 31 |
'--html-fontsize=[Set fontsize to N pt, default is 4.]' \ |
| 32 |
'--html-no-bold[Do not use bold characters with HTML output.]' \ |
| 33 |
'--html-raw[Output raw HTML codes, i.e. without the <head> section etc. (Will use <br> for version 2.0.0 and above.)]' \ |
| 34 |
'--html-title=[Set HTML output title]' \ |
| 35 |
'(-i --invert --background)'{-i,--invert}'[Invert output image. Use if your display has a dark background.]' \ |
| 36 |
'(-i --invert --background)--background=[dark or light. These are just mnemonics whether to use --invert or not. If your console has light characters on a dark background, use --background=dark.]:background:(dark light)' \ |
| 37 |
'--output=[Write output to file.]::' \ |
| 38 |
'--size=[Set output width and height.]::' \ |
| 39 |
'(-v --verbose)'{-v,--verbose}'[Verbose output.]' \ |
| 40 |
'(- *)'{-v,--version}'[Print program version.]' \ |
| 41 |
'--width=[Set output width, calculate height from ratio.]::' \ |
| 42 |
'*:images:->images' |
| 43 |
|
| 44 |
case "$state" in |
| 45 |
images) |
| 46 |
local -a image_files |
| 47 |
image_files=( *.{jpg,jpeg,png,webp} "http://" "https://" "file://" ) |
| 48 |
_multi_parts / image_files |
| 49 |
;; |
| 50 |
esac |