From 4a858b566535ff1d794eb74e993de7d18a77ada6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Sun, 1 May 2022 12:21:46 +0200 Subject: [PATCH] meson: Add bash completion MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- config/bash/meson.build | 39 +++++++++++++++++++++++++++++++++++++++ meson.build | 2 ++ 2 files changed, 41 insertions(+) create mode 100644 config/bash/meson.build 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') -- 2.47.2