completions: add zsh completions

This commit is contained in:
Daniel Eklöf 2019-10-20 11:54:58 +02:00
parent 286db002f8
commit 6643fe5456
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 17 additions and 0 deletions

2
completions/meson.build Normal file
View file

@ -0,0 +1,2 @@
zsh_install_dir = join_paths(get_option('datadir'), 'zsh/site-functions')
install_data('zsh/_foot', install_dir: zsh_install_dir)

14
completions/zsh/_foot Normal file
View file

@ -0,0 +1,14 @@
#compdef foot
_arguments \
-s \
'(-v --version)'{-v,--version}'[show the version number and quit]' \
'(-h --help)'{-h,--help}'[show help message and quit]' \
'(-f --font)'{-f,--font}'[font name and style in fontconfig format (monospace)]:font:->fonts' \
'(-g --geometry)'{-g,--geometry}'[window WIDTHxHEIGHT, in pixels (84x24 cells)]'
case "${state}" in
fonts)
_values 'font families' $(fc-list : family | tr -d ' ')
;;
esac

View file

@ -98,4 +98,5 @@ custom_target(
install_data('foot.desktop', install_dir: join_paths(get_option('datadir'), 'applications'))
install_data('footrc', install_dir: join_paths(get_option('datadir'), 'foot'))
subdir('completions')
subdir('doc')