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);