From: Stéphane Graber Date: Sun, 1 May 2022 10:21:46 +0000 (+0200) Subject: meson: Add bash completion X-Git-Tag: lxc-5.0.0~21^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4109%2Fhead;p=thirdparty%2Flxc.git meson: Add bash completion Signed-off-by: Stéphane Graber --- diff --git a/config/bash/meson.build b/config/bash/meson.build new file mode 100644 index 000000000..f261995d7 --- /dev/null +++ b/config/bash/meson.build @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +bash_completion = configure_file( + configuration: conf, + input: 'lxc.in', + output: 'lxc', + install: true, + install_dir: bashcompletiondir) + + +foreach cmd: [ + 'lxc-attach', + 'lxc-autostart', + 'lxc-cgroup', + 'lxc-checkpoint', + 'lxc-config', + 'lxc-console', + 'lxc-copy', + 'lxc-create', + 'lxc-destroy', + 'lxc-device', + 'lxc-execute', + 'lxc-freeze', + 'lxc-info', + 'lxc-ls', + 'lxc-monitor', + 'lxc-snapshot', + 'lxc-start', + 'lxc-stop', + 'lxc-top', + 'lxc-unfreeze', + 'lxc-unshare', + 'lxc-usernsexec', + 'lxc-wait', +] + install_symlink(cmd, + pointing_to: 'lxc', + install_dir: bashcompletiondir) +endforeach diff --git a/meson.build b/meson.build index b419cf3ec..058f33c8f 100644 --- a/meson.build +++ b/meson.build @@ -57,6 +57,7 @@ rootfsmount = get_option('rootfs-mount-dir') user_network_db_opt = get_option('user-network-db') user_network_conf_opt = get_option('user-network-conf') +bashcompletiondir = join_paths('/', 'usr', 'share', 'bash-completion', 'completions') bindir = join_paths(prefixdir, get_option('bindir')) datadir = join_paths(prefixdir, get_option('datadir')) docdir = join_paths(prefixdir, get_option('docdir')) @@ -598,6 +599,7 @@ liblxc_dep = declare_dependency( dependencies: liblxc_dependencies) # Rest of sub-directories. +subdir('config/bash') subdir('doc/rootfs') subdir('hooks') subdir('src/lxc/cmd')