Tools: Add bash completions for xkbcli
[platform/upstream/libxkbcommon.git] / tools / xkbcli.c
index fe6b6b5..3602fb9 100644 (file)
@@ -37,6 +37,9 @@ usage(void)
            "Global options:\n"
            "  -h, --help ...... show this help and exit\n"
            "  -V, --version ... show version information and exit\n"
+           /* WARNING: The following is parsed by the bash completion script.
+            *          Any change to the format (in particular to the indentation)
+            *          should kept in the script in sync. */
            "Commands:\n"
 #if HAVE_XKBCLI_LIST
            "  list\n"
@@ -45,22 +48,22 @@ usage(void)
 #endif
 #if HAVE_XKBCLI_INTERACTIVE_WAYLAND
            "  interactive-wayland\n"
-           "    Interactive debugger for XKB maps for wayland\n"
+           "    Interactive debugger for XKB keymaps for Wayland\n"
            "\n"
 #endif
-#if HAVE_XKBCLI_INTERACTIVE_x11
+#if HAVE_XKBCLI_INTERACTIVE_X11
            "  interactive-x11\n"
-           "    Interactive debugger for XKB maps for X11\n"
+           "    Interactive debugger for XKB keymaps for X11\n"
            "\n"
 #endif
 #if HAVE_XKBCLI_INTERACTIVE_EVDEV
            "  interactive-evdev\n"
-           "    Interactive debugger for XKB maps for evdev\n"
+           "    Interactive debugger for XKB keymaps for evdev\n"
            "\n"
 #endif
 #if HAVE_XKBCLI_COMPILE_KEYMAP
            "  compile-keymap\n"
-           "    Compile n XKB keymap\n"
+           "    Compile an XKB keymap\n"
            "\n"
 #endif
 #if HAVE_XKBCLI_HOW_TO_TYPE
@@ -82,7 +85,6 @@ main(int argc, char **argv)
 
     while (1) {
         int c;
-#if HAVE_GETOPT_LONG
         static struct option opts[] = {
             { "help",    no_argument, 0, OPT_HELP },
             { "version", no_argument, 0, OPT_VERSION },
@@ -90,9 +92,6 @@ main(int argc, char **argv)
         };
 
         c = getopt_long(argc, argv, "+hV", opts, &option_index);
-#else
-        c = getopt(argc, argv, "+hV");
-#endif
         if (c == -1)
             break;