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"
43 " List available rules, models, layouts, variants and options\n"
46 #if HAVE_XKBCLI_INTERACTIVE_WAYLAND
47 " interactive-wayland\n"
48 " Interactive debugger for XKB keymaps for Wayland\n"
51 #if HAVE_XKBCLI_INTERACTIVE_X11
53 " Interactive debugger for XKB keymaps for X11\n"
56 #if HAVE_XKBCLI_INTERACTIVE_EVDEV
57 " interactive-evdev\n"
58 " Interactive debugger for XKB keymaps for evdev\n"
61 #if HAVE_XKBCLI_COMPILE_KEYMAP
63 " Compile an XKB keymap\n"
66 #if HAVE_XKBCLI_HOW_TO_TYPE
68 " Print key sequences to type a Unicode codepoint\n"
75 main(int argc, char **argv)
85 static struct option opts[] = {
86 { "help", no_argument, 0, OPT_HELP },
87 { "version", no_argument, 0, OPT_VERSION },
91 c = getopt_long(argc, argv, "+hV", opts, &option_index);
102 printf("%s\n", LIBXKBCOMMON_VERSION);
106 return EXIT_INVALID_USAGE;
110 if (optind >= argc) {
112 return EXIT_INVALID_USAGE;
118 return tools_exec_command("xkbcli", argc, argv);