Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for bash-completion #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,19 @@ subdir('po')
subdir('src')
subdir('tests')

if get_option('bash_completion')
bash_comp = dependency('bash_completion', required: false)
if bash_comp.found()
bash_install_dir = bash_comp.get_variable(
pkgconfig: 'completionsdir',
pkgconfig_define: ['datadir', datadir]
)
else
bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
endif
install_data('tools/bash-completion.sh', install_dir: bash_install_dir, rename: 'aegisub')
endif

aegisub_cpp_pch = ['src/include/agi_pre.h']
aegisub_c_pch = ['src/include/agi_pre_c.h']

Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ option('update_server', type: 'string', value: 'https://updates.aegisub.org', de
option('update_url', type: 'string', value: '/trunk', description: 'Base path to use for the update checker')

option('build_osx_bundle', type: 'boolean', value: 'false', description: 'Package Aegisub.app on OSX')
option('bash_completion', type: 'boolean', value: 'true', description: 'Install bash shell completions.')
2 changes: 2 additions & 0 deletions tools/bash-completion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
complete -f -o plusdirs -X '!*.@(ass|ssa|mkv|mka|mks|sub|srt|ttxt|txt)' aegisub