tools: always print the rmlvo-to-keymap outcome The most common case for this tool is to check what the keymap is for a given RMLVO. Let's print that by default, the use-cases that just check for compilation success can discard stdout instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
diff --git a/tools/rmlvo-to-keymap.c b/tools/rmlvo-to-keymap.c
index 3a98527..54591bf 100644
--- a/tools/rmlvo-to-keymap.c
+++ b/tools/rmlvo-to-keymap.c
@@ -33,22 +33,18 @@
#include "xkbcommon/xkbcommon.h"
-static bool print = false;
-
static void
usage(char **argv)
{
- printf("Usage: %s [--print] [--rules <rules>] [--layout <layout>] [--variant <variant>] [--options <option>]\n",
+ printf("Usage: %s [--rules <rules>] [--layout <layout>] [--variant <variant>] [--options <option>]\n",
argv[0]);
- printf("This tool tests the compilation from RMLVO to a keymap.\n");
- printf("--print print the resulting keymap\n");
+ printf("Compile the RMLVO to a keymap and print it.\n");
}
static bool
parse_options(int argc, char **argv, struct xkb_rule_names *names)
{
enum options {
- OPT_PRINT,
OPT_RULES,
OPT_MODEL,
OPT_LAYOUT,
@@ -57,7 +53,6 @@ parse_options(int argc, char **argv, struct xkb_rule_names *names)
};
static struct option opts[] = {
{"help", no_argument, 0, 'h'},
- {"print", no_argument, 0, OPT_PRINT},
{"rules", required_argument, 0, OPT_RULES},
{"model", required_argument, 0, OPT_MODEL},
{"layout", required_argument, 0, OPT_LAYOUT},
@@ -77,9 +72,6 @@ parse_options(int argc, char **argv, struct xkb_rule_names *names)
case 'h':
usage(argv);
exit(0);
- case OPT_PRINT:
- print = true;
- break;
case OPT_RULES:
names->rules = optarg;
break;
@@ -133,7 +125,7 @@ main(int argc, char **argv)
keymap = xkb_keymap_new_from_names(ctx, &names, XKB_KEYMAP_COMPILE_NO_FLAGS);
rc = (keymap == NULL);
- if (rc == 0 && print)
+ if (rc == 0)
printf("%s\n", xkb_keymap_get_as_string(keymap,
XKB_KEYMAP_FORMAT_TEXT_V1));