Tools: Add bash completions for xkbcli
authorPierre Le Marre <dev@wismill.eu>
Fri, 29 Sep 2023 18:44:06 +0000 (20:44 +0200)
committerWismill <dev@wismill.eu>
Thu, 5 Oct 2023 04:24:02 +0000 (06:24 +0200)
commit1c1542d64f37c67bf29c3de1e06735fd79cc50ea
tree610e42061526f719fc91cca2960ea2447d4b0ff7
parent357c00b3a1c28afeb352887397ab9549740f1c85
Tools: Add bash completions for xkbcli

- Add bash completion script. It parses the commands help messages to
  provide the completions, thus any new subcommand or option will be
  supported, as long as it has its entry in the help messages. This
  should result in low maintenancei effort.
- Add installation entry in Meson. The path can be configured using
  the following options:
  - `enable-bash-completion` to enable the installation;
  - `bash-completion-path` to control the installation path. It will
    default to: `share/bash-completion/completions`.

TODO: completion for other shells, such as zsh?
meson.build
meson_options.txt
tools/compile-keymap.c
tools/xkbcli-bash-completion.sh [new file with mode: 0755]
tools/xkbcli.c