summaryrefslogtreecommitdiff
path: root/tools/interactive-x11.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-07-09 12:15:45 +1000
committerRan Benita <ran@unusedvar.com>2020-07-25 11:05:14 +0300
commit714182066d086baf848c22258136c8dd94a4edca (patch)
treefddfd36b275ca9a6ed3914854ea42cc3294f1ee9 /tools/interactive-x11.c
parent29e80e7b7608961a9400eaa10880c4a25e5e3726 (diff)
downloadxorg-lib-libxkbcommon-714182066d086baf848c22258136c8dd94a4edca.tar.gz
tools: consistently return 2 on invalid usage
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/interactive-x11.c')
-rw-r--r--tools/interactive-x11.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/interactive-x11.c b/tools/interactive-x11.c
index d98433e..c7ca9aa 100644
--- a/tools/interactive-x11.c
+++ b/tools/interactive-x11.c
@@ -26,6 +26,7 @@
#include <locale.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <string.h>
#include <xcb/xkb.h>
@@ -336,6 +337,14 @@ main(int argc, char *argv[])
struct xkb_context *ctx;
struct keyboard core_kbd;
+ if (argc != 1) {
+ ret = strcmp(argv[1], "--help");
+ fprintf(ret ? stderr : stdout, "Usage: %s [--help]\n", argv[0]);
+ if (ret)
+ fprintf(stderr, "unrecognized option: %s\n", argv[1]);
+ return ret ? EXIT_INVALID_USAGE : EXIT_SUCCESS;
+ }
+
setlocale(LC_ALL, "");
conn = xcb_connect(NULL, NULL);