2021-11-21 14:16:07 +00:00
|
|
|
generate_completions_program = find_program('generate_completions.py')
|
|
|
|
|
2022-09-09 17:04:24 +00:00
|
|
|
if bash_completion_dep.found()
|
|
|
|
bashcompletionsdir = bash_completion_dep.get_variable(pkgconfig: 'completionsdir')
|
2021-11-21 14:16:07 +00:00
|
|
|
else
|
2022-09-09 17:04:24 +00:00
|
|
|
bashcompletionsdir = get_option('datadir') / 'bash-completion' / 'completions'
|
|
|
|
message('bash-completion not found: using', get_option('prefix') / bashcompletionsdir, 'as a falback install directory')
|
2021-11-21 14:16:07 +00:00
|
|
|
endif
|
|
|
|
|
2022-09-09 17:04:24 +00:00
|
|
|
if fish_dep.found()
|
|
|
|
fishcompletionsdir = fish_dep.get_variable(pkgconfig: 'completionsdir')
|
2021-11-21 14:16:07 +00:00
|
|
|
else
|
2022-09-09 17:04:24 +00:00
|
|
|
fishcompletionsdir = get_option('datadir') / 'fish' / 'completions'
|
|
|
|
message('fish not found: using', get_option('prefix') / fishcompletionsdir, 'as a fallback install directory')
|
2021-11-21 14:16:07 +00:00
|
|
|
endif
|
|
|
|
|
2022-09-12 07:50:21 +00:00
|
|
|
custom_target(
|
|
|
|
'bash-completion',
|
2021-11-21 14:16:07 +00:00
|
|
|
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,
|
2022-09-09 17:04:24 +00:00
|
|
|
install_dir: bashcompletionsdir,
|
2022-10-21 13:57:47 +00:00
|
|
|
output: 'toolbox',
|
2022-09-12 07:50:21 +00:00
|
|
|
)
|
2021-11-21 14:16:07 +00:00
|
|
|
|
2022-09-12 07:50:21 +00:00
|
|
|
custom_target(
|
|
|
|
'zsh-completion',
|
2021-11-21 14:16:07 +00:00
|
|
|
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',
|
2022-10-21 13:57:47 +00:00
|
|
|
output: '_toolbox',
|
2022-09-12 07:50:21 +00:00
|
|
|
)
|
2021-11-21 14:16:07 +00:00
|
|
|
|
2022-09-12 07:50:21 +00:00
|
|
|
custom_target(
|
|
|
|
'fish-completion',
|
2021-11-21 14:16:07 +00:00
|
|
|
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,
|
2022-09-09 17:04:24 +00:00
|
|
|
install_dir: fishcompletionsdir,
|
2022-10-21 13:57:47 +00:00
|
|
|
output: 'toolbox.fish',
|
2022-09-12 07:50:21 +00:00
|
|
|
)
|