]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
meson: Add bash completion 4109/head
authorStéphane Graber <stgraber@ubuntu.com>
Sun, 1 May 2022 10:21:46 +0000 (12:21 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Sun, 1 May 2022 10:21:53 +0000 (12:21 +0200)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
config/bash/meson.build [new file with mode: 0644]
meson.build

diff --git a/config/bash/meson.build b/config/bash/meson.build
new file mode 100644 (file)
index 0000000..f261995
--- /dev/null
@@ -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
index b419cf3ecca612c3831684d96f42a98209f29acd..058f33c8fa9e96821fa3f9834ca1533e9860e01c 100644 (file)
@@ -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')