2 * Copyright © 2020 Red Hat, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
30 #include "tools-common.h"
35 printf("Usage: xkbcli [--help|-h] [--version|-V] <command> [<args>]\n"
38 " -h, --help ...... show this help and exit\n"
39 " -V, --version ... show version information and exit\n"
40 /* WARNING: The following is parsed by the bash completion script.
41 * Any change to the format (in particular to the indentation)
42 * should kept in the script in sync. */
46 " List available rules, models, layouts, variants and options\n"
49 #if HAVE_XKBCLI_INTERACTIVE_WAYLAND
50 " interactive-wayland\n"
51 " Interactive debugger for XKB keymaps for Wayland\n"
54 #if HAVE_XKBCLI_INTERACTIVE_X11
56 " Interactive debugger for XKB keymaps for X11\n"
59 #if HAVE_XKBCLI_INTERACTIVE_EVDEV
60 " interactive-evdev\n"
61 " Interactive debugger for XKB keymaps for evdev\n"
64 #if HAVE_XKBCLI_COMPILE_KEYMAP
66 " Compile an XKB keymap\n"
69 #if HAVE_XKBCLI_HOW_TO_TYPE
71 " Print key sequences to type a Unicode codepoint\n"
78 main(int argc, char **argv)
88 static struct option opts[] = {
89 { "help", no_argument, 0, OPT_HELP },
90 { "version", no_argument, 0, OPT_VERSION },
94 c = getopt_long(argc, argv, "+hV", opts, &option_index);
105 printf("%s\n", LIBXKBCOMMON_VERSION);
109 return EXIT_INVALID_USAGE;
113 if (optind >= argc) {
115 return EXIT_INVALID_USAGE;
121 return tools_exec_command("xkbcli", argc, argv);