@@ -53,6 +53,7 @@ struct keyboard {
53
53
struct keyboard * next ;
54
54
};
55
55
56
+ static bool verbose = false;
56
57
static bool terminate ;
57
58
static int evdev_offset = 8 ;
58
59
static bool report_state_changes ;
@@ -383,6 +384,7 @@ usage(FILE *fp, char *progname)
383
384
fprintf (fp , " or: %s --keymap <path to keymap file>\n" ,
384
385
progname );
385
386
fprintf (fp , "For both:\n"
387
+ " --verbose (enable verbose debugging output)\n"
386
388
#ifdef ENABLE_PRIVATE_APIS
387
389
" --print-modmaps (print real & virtual key modmaps)\n"
388
390
#endif
@@ -415,6 +417,7 @@ main(int argc, char *argv[])
415
417
const char * locale ;
416
418
struct sigaction act ;
417
419
enum options {
420
+ OPT_VERBOSE ,
418
421
OPT_INCLUDE ,
419
422
OPT_INCLUDE_DEFAULTS ,
420
423
OPT_RULES ,
@@ -434,6 +437,7 @@ main(int argc, char *argv[])
434
437
};
435
438
static struct option opts [] = {
436
439
{"help" , no_argument , 0 , 'h' },
440
+ {"verbose" , no_argument , 0 , OPT_VERBOSE },
437
441
{"include" , required_argument , 0 , OPT_INCLUDE },
438
442
{"include-defaults" , no_argument , 0 , OPT_INCLUDE_DEFAULTS },
439
443
{"rules" , required_argument , 0 , OPT_RULES },
@@ -464,6 +468,9 @@ main(int argc, char *argv[])
464
468
break ;
465
469
466
470
switch (opt ) {
471
+ case OPT_VERBOSE :
472
+ verbose = true;
473
+ break ;
467
474
case OPT_INCLUDE :
468
475
if (num_includes >= ARRAY_SIZE (includes )) {
469
476
fprintf (stderr , "error: too many includes\n" );
@@ -539,6 +546,11 @@ main(int argc, char *argv[])
539
546
goto out ;
540
547
}
541
548
549
+ if (verbose ) {
550
+ xkb_context_set_log_level (ctx , XKB_LOG_LEVEL_DEBUG );
551
+ xkb_context_set_log_verbosity (ctx , 10 );
552
+ }
553
+
542
554
if (num_includes == 0 )
543
555
includes [num_includes ++ ] = DEFAULT_INCLUDE_PATH_PLACEHOLDER ;
544
556
0 commit comments