diff --git a/meson.build b/meson.build index dad9114..4fb34b8 100644 --- a/meson.build +++ b/meson.build @@ -79,12 +79,11 @@ address_sanitizer = get_option('b_sanitize') == 'address' or \ get_option('b_sanitize') == 'leak' bashcomp = dependency('bash-completion', required: get_option('bashcomp')) -zshcomp = get_option('zshcomp') != '' python = import('python') python3 = python.find_installation('python3') -if bashcomp.found() or zshcomp +if bashcomp.found() or get_option('zshcomp') python3_required_modules += 'shtab' gi_required_modules += powerprofilesctl_required_gi_modules endif diff --git a/meson_options.txt b/meson_options.txt index 37c21b4..a4bd1b5 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -23,6 +23,6 @@ option('bashcomp', type: 'feature', value: 'auto') option('zshcomp', - description: 'path for zsh completion file', - type: 'string', - value: '') + description: 'generate zsh completion file', + type: 'feature', + value: 'auto') diff --git a/src/completions/meson.build b/src/completions/meson.build index 10001f1..6c5dc8c 100644 --- a/src/completions/meson.build +++ b/src/completions/meson.build @@ -23,14 +23,14 @@ if bashcomp.found() ) endif -if zshcomp +if get_option('zshcomp') custom_target('zsh-completion', output: '_powerprofilesctl', command: [ generate_completion, 'zsh', ], - install_dir: get_option('zshcomp'), + install_dir: get_option('datadir') / 'zsh' / 'site-functions', kwargs: completions_common, ) endif