Skip to content

Commit

Permalink
* complete font-list
Browse files Browse the repository at this point in the history
  • Loading branch information
crpb committed Jan 2, 2024
1 parent a1ab5fb commit d818a12
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions completion/_ubanner
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

# zsh completion for ubanner

local arguments=(
{-h,--help}'[show help]'
'--trim[trim leading/trailing empty lines]'
'--font[use this font]'
'--font-size[font size in pixels (default: 28)]:size:(28 36 42 50 58 64 72 80 88 96)'
{-s,--full-screen}'[full screen mode]'
)

_arguments -s -S $arguments
#typeset -A opt_args

_arguments -s -S \
{-h,--help}'[show help]' \
'--trim[trim leading/trailing empty lines]' \
'--font[use this font]:fontname:->fonts' \
'--font-size[font size in pixels (default: 28)]:size:(28 36 42 50 58 64 72 80 88 96)' \
'--list-fonts[print list of available font faces]' \
{-s,--full-screen}'[full screen mode]' && return 0

case "$state" in
fonts)
local -a fontfaces
fontfaces=("${(@f)$(ubanner --list-fonts)}")
_values "fontname" $fontfaces
;;
esac

0 comments on commit d818a12

Please sign in to comment.