diff --git a/completions/meson.build b/completions/meson.build new file mode 100644 index 00000000..5ab3dded --- /dev/null +++ b/completions/meson.build @@ -0,0 +1,2 @@ +zsh_install_dir = join_paths(get_option('datadir'), 'zsh/site-functions') +install_data('zsh/_foot', install_dir: zsh_install_dir) diff --git a/completions/zsh/_foot b/completions/zsh/_foot new file mode 100644 index 00000000..cbdc7032 --- /dev/null +++ b/completions/zsh/_foot @@ -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 diff --git a/meson.build b/meson.build index d86ed199..22987aa4 100644 --- a/meson.build +++ b/meson.build @@ -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')