diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2020-07-06 16:07:11 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2020-07-08 15:21:19 +1000 |
commit | 4889f550df2acaaec1697d54dc3631a5c6fc53cf (patch) | |
tree | 5f192d539c44de79e38a1e2c32ef2dfc80812ee0 /tools | |
parent | e55587f4cfe50e12ca6feafe1fbbb9250bfaa90c (diff) | |
download | xorg-lib-libxkbcommon-4889f550df2acaaec1697d54dc3631a5c6fc53cf.tar.gz |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/rmlvo-to-keymap.c | 14 |
1 files changed, 3 insertions, 11 deletions
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)); |