2021-11-21 14:16:07 +00:00
|
|
|
generate_completions_program = find_program('generate_completions.py')
|
|
|
|
|
|
|
|
if bash_completion.found()
|
2022-08-31 17:24:41 +00:00
|
|
|
bash_comp_dir = bash_completion.get_variable(pkgconfig: 'completionsdir')
|
2021-11-21 14:16:07 +00:00
|
|
|
else
|
|
|
|
bash_comp_dir = get_option('datadir') / 'bash-completion' / 'completions'
|
|
|
|
message('bash-completion not found: using', get_option('prefix') / bash_comp_dir, 'as a falback install directory')
|
|
|
|
endif
|
|
|
|
|
|
|
|
if fish.found()
|
2022-08-31 17:24:41 +00:00
|
|
|
fish_comp_dir = fish.get_variable(pkgconfig: 'completionsdir')
|
2021-11-21 14:16:07 +00:00
|
|
|
else
|
|
|
|
fish_comp_dir = get_option('datadir') / 'fish' / 'completions'
|
|
|
|
message('fish not found: using', get_option('prefix') / fish_comp_dir, 'as a fallback install directory')
|
|
|
|
endif
|
|
|
|
|
|
|
|
completion_bash = custom_target('bash-completion',
|
|
|
|
capture: true,
|
|
|
|
command: [generate_completions_program, meson.global_source_root() / 'src', 'bash'],
|
2022-09-09 13:30:28 +00:00
|
|
|
depends: [toolbox_go],
|
2021-11-21 14:16:07 +00:00
|
|
|
install: true,
|
|
|
|
install_dir: bash_comp_dir,
|
|
|
|
output: 'toolbox')
|
|
|
|
|
|
|
|
completion_zsh = custom_target('zsh-completion',
|
|
|
|
capture: true,
|
|
|
|
command: [generate_completions_program, meson.global_source_root() / 'src', 'zsh'],
|
2022-09-09 13:30:28 +00:00
|
|
|
depends: [toolbox_go],
|
2021-11-21 14:16:07 +00:00
|
|
|
install: true,
|
2022-05-20 12:37:36 +00:00
|
|
|
install_dir: get_option('datadir') / 'zsh' / 'site-functions',
|
2021-11-21 14:16:07 +00:00
|
|
|
output: '_toolbox')
|
|
|
|
|
|
|
|
completion_fish = custom_target('fish-completion',
|
|
|
|
capture: true,
|
|
|
|
command: [generate_completions_program, meson.global_source_root() / 'src', 'fish'],
|
2022-09-09 13:30:28 +00:00
|
|
|
depends: [toolbox_go],
|
2021-11-21 14:16:07 +00:00
|
|
|
install: true,
|
|
|
|
install_dir: fish_comp_dir,
|
|
|
|
output: 'toolbox.fish')
|