From 6643fe5456dee5193f2756e20eef8f2f784c322f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 20 Oct 2019 11:54:58 +0200 Subject: [PATCH] completions: add zsh completions --- completions/meson.build | 2 ++ completions/zsh/_foot | 14 ++++++++++++++ meson.build | 1 + 3 files changed, 17 insertions(+) create mode 100644 completions/meson.build create mode 100644 completions/zsh/_foot 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')