- int shortformat = False;
- int daemon = False;
-
- shortformat = (argc == 1 && strcmp(argv[0], "--short") == 0);
- daemon = (argc == 1 && strcmp(argv[0], "--loop") == 0);
-
- if (argc == 0 || shortformat || daemon) {
- int num_devices;
-
- do {
- info = XListInputDevices(display, &num_devices);
- for(loop=0; loop<num_devices; loop++) {
- print_info(info+loop, shortformat);
- }
- } while(daemon);
- } else {
- int ret = EXIT_SUCCESS;