]> diplodocus.org Git - xorg-xinput/blobdiff - src/setmode.c
autogen.sh: use exec instead of waiting for configure to finish
[xorg-xinput] / src / setmode.c
index 4bac6df34653c1354eff5d3a06ea9849349f308d..4008a74dbab619e25686e1e9edf445d1240b4633 100644 (file)
@@ -43,14 +43,17 @@ set_mode(Display    *display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return EXIT_FAILURE;
     }
 
     if (strcmp(argv[1], "ABSOLUTE") == 0) {
        mode = Absolute;
-    } else {
+    } else if (strcmp(argv[1], "RELATIVE") == 0) {
        mode = Relative;
+    } else {
+       fprintf(stderr, "Invalid mode, use ABSOLUTE or RELATIVE.\n");
+       return EXIT_FAILURE;
     }
 
     device = XOpenDevice(display, info->id);