tools/xkbcli.c


Log

Author Commit Date CI Message
Pierre Le Marre 1c1542d6 2023-09-29T20:44:06 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?
Ran Benita 6b65be4c 2021-03-28T12:55:08 interactive-evdev: switch from epoll(2) to poll(2) Turns out FreeBSD supports evdev, so this toll can work on it; however it does not support epoll, so switch to poll, which is portable. Reported-by: Evgeniy Khramtsov <evgeniy@khramtsov.org> Signed-off-by: Ran Benita <ran@unusedvar.com>
Ran Benita 0f8ae6ec 2020-09-05T23:41:08 xkbcli: fix interactive-x11 not showing in help Signed-off-by: Ran Benita <ran@unusedvar.com>
Ran Benita f439ce18 2020-07-25T11:17:11 tools: some minor changes to xkbcli Signed-off-by: Ran Benita <ran@unusedvar.com>
Peter Hutterer 449ed2b8 2020-07-13T12:28:43 tools: drop getopt vs getopt_long differentiation On all platforms we build on where getopt.h is available, getopt_long is also available. Only Windows doesn't have either but that's no reason for us to differentiate between the two. If we need to special-case getopt vs getopt_long, it's probably better to implement our own cross-platform version of it and use that. Fixes #161 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer 29e80e7b 2020-07-08T13:30:47 tools: install our tools as xkbcli subcommands The xkbcli tool usage help is ifdef'd out where the tool isn't built but the man page always includes all tools. Easier that way. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer ed57fb8b 2020-07-08T12:51:54 tools: add a xkbcli tool as entry point for the various tools we have This is the base tool, no subtools are currently connected so you only get help and version for now. The goal here is to have a git-like infrastructure where /usr/bin/xkbcli is the main tool, anything else will hide in libexec. The infrastructure for this is copied from libinput. Tools themselves will will be installed in $prefix/libexec/xkbcommon and the xkbcli tool forks off whatever argv[1] is after modifying the PATH to include the libexec dir. libinput has additional code for checking whether we're running this from the builddir but it's a bit iffy and it's usefulness is limited - if you're in the builddir anyway you can just run ./builddir/xkbcli-<toolname> directly. So for this code here, running ./builddir/xkbcli <toolname> will execute the one in the prefix/libexecdir. Since we want that tool available everywhere even where some of the subtools aren't present, we need to ifdef the getopt handling. man page generation is handled via ronn which is a ruby program but allows markdown for the sources. It's hidden behind a meson option to disable where downloading ronn isn't an option. The setup is generic enough that we can add other man-pages by just appending to the array. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>