1 # SPDX-License-Identifier: LGPL-2.1-or-later
3 bashcompletiondir = get_option('bashcompletiondir')
4 if bashcompletiondir == ''
5 bash_completion = dependency('bash-completion', required : false)
6 if bash_completion.found()
7 bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir')
9 bashcompletiondir = datadir / 'bash-completion/completions'
15 input : 'systemctl.in',
17 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
18 install : bashcompletiondir != 'no',
19 install_dir : bashcompletiondir)
21 items = [['busctl', ''],
23 ['systemd-analyze', ''],
26 ['systemd-cgtop', ''],
27 ['systemd-delta', ''],
28 ['systemd-detect-virt', ''],
29 ['systemd-id128', ''],
30 ['systemd-nspawn', ''],
34 ['kernel-install', 'ENABLE_KERNEL_INSTALL'],
35 ['bootctl', 'HAVE_GNU_EFI'],
36 ['coredumpctl', 'ENABLE_COREDUMP'],
37 ['homectl', 'ENABLE_HOMED'],
38 ['hostnamectl', 'ENABLE_HOSTNAMED'],
39 ['localectl', 'ENABLE_LOCALED'],
40 ['loginctl', 'ENABLE_LOGIND'],
41 ['machinectl', 'ENABLE_MACHINED'],
42 ['networkctl', 'ENABLE_NETWORKD'],
43 ['oomctl', 'ENABLE_OOMD'],
44 ['portablectl', 'ENABLE_PORTABLED'],
45 ['resolvectl', 'ENABLE_RESOLVE'],
46 ['systemd-resolve', 'ENABLE_RESOLVE'],
47 ['timedatectl', 'ENABLE_TIMEDATED']]
50 if bashcompletiondir != 'no' and (item[1] == '' or conf.get(item[1]) == 1)
52 install_dir : bashcompletiondir)