{
struct libinput *li;
struct timespec tp;
- enum tools_backend backend = BACKEND_UDEV;
+ enum tools_backend backend = BACKEND_NONE;
const char *seat_or_device = "seat0";
bool grab = false;
bool verbose = false;
}
if (optind < argc) {
- usage();
- return EXIT_INVALID_USAGE;
+ if (optind < argc - 1 || backend != BACKEND_NONE) {
+ usage();
+ return EXIT_INVALID_USAGE;
+ }
+ backend = BACKEND_DEVICE;
+ seat_or_device = argv[optind];
+ } else if (backend == BACKEND_NONE) {
+ backend = BACKEND_UDEV;
}
memset(&act, 0, sizeof(act));
.SH NAME
libinput\-debug\-events \- debug helper for libinput
.SH SYNOPSIS
-.B libinput debug\-events [\-\-help] [\-\-show\-keycodes] [\-\-udev \fI<seat>\fB|\-\-device \fI/dev/input/event0\fB] \fI[configuration options]\fB
+.B libinput debug\-events \fI[options]\fB
+.PP
+.B libinput debug\-events \fI[options]\fB \-\-udev \fI<seat>\fB
+.PP
+.B libinput debug\-events \fI[options]\fB [\-\-device] \fI/dev/input/event0\fB
.SH DESCRIPTION
.PP
The
.SH OPTIONS
.TP 8
.B \-\-device \fI/dev/input/event0\fR
-Use the given device with the path backend
+Use the given device with the path backend. The \fB\-\-device\fR argument may be
+omitted.
.TP 8
.B \-\-grab
Exclusively grab all opened devices. This will prevent events from being
static void
usage(void) {
- printf("Usage: libinput debug-gui [options] [--udev <seat>|--device /dev/input/event0]\n");
+ printf("Usage: libinput debug-gui [options] [--udev <seat>|[--device] /dev/input/event0]\n");
}
static gboolean
struct window w = {0};
struct tools_options options;
struct libinput *li;
- enum tools_backend backend = BACKEND_UDEV;
+ enum tools_backend backend = BACKEND_NONE;
const char *seat_or_device = "seat0";
bool verbose = false;
}
if (optind < argc) {
- usage();
- return EXIT_INVALID_USAGE;
+ if (optind < argc - 1 || backend != BACKEND_NONE) {
+ usage();
+ return EXIT_INVALID_USAGE;
+ }
+ backend = BACKEND_DEVICE;
+ seat_or_device = argv[optind];
+ } else if (backend == BACKEND_NONE) {
+ backend = BACKEND_UDEV;
}
li = tools_open_backend(backend, seat_or_device, verbose, &w.grab);
.SH NAME
libinput\-debug\-gui \- visual debug helper for libinput
.SH SYNOPSIS
-.B libinput debug\-gui [\-\-help] [\-\-udev \fI<seat>\fB|\-\-device \fI/dev/input/event0\fB] \fI[configuration options]\fB
+.B libinput debug\-gui \fI[options]\fB
+.PP
+.B libinput debug\-gui \fI[options]\fB \-\-udev \fI<seat>\fB
+.PP
+.B libinput debug\-gui \fI[options]\fB [\-\-device] \fI/dev/input/event0\fB
.SH DESCRIPTION
.PP
The
.SH OPTIONS
.TP 8
.B \-\-device \fI/dev/input/event0\fR
-Use the given device with the path backend.
+Use the given device with the path backend. The \fB\-\-device\fR argument may be
+omitted.
.TP 8
.B \-\-grab
Exclusively grab all opened devices. This will prevent events from being
{ "set-speed", required_argument, 0, OPT_SPEED }
enum tools_backend {
+ BACKEND_NONE,
BACKEND_DEVICE,
BACKEND_UDEV
};
self.run_command_missing_arg(['--device'])
self.run_command_success(['--device', '/dev/input/event0'])
self.run_command_success(['--device', '/dev/input/event1'])
+ self.run_command_success(['/dev/input/event0'])
def test_options_pattern(self):
for option in self.options['pattern']: