diff options
author | Sergey Udaltsov <svu@gnome.org> | 2004-09-30 01:17:57 +0000 |
---|---|---|
committer | Sergey Udaltsov <svu@gnome.org> | 2004-09-30 01:17:57 +0000 |
commit | 0eeefba9ec2452633de36046f5b90290ee89986e (patch) | |
tree | e2193ee695b515e1b3d73e0ccea598779c05e57a /tests | |
parent | 879f88ca19af1758ecc927375b97be95efa262de (diff) | |
download | libxklavier-0eeefba9ec2452633de36046f5b90290ee89986e.tar.gz |
now, test_config can set debug level as well
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_config.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_config.c b/tests/test_config.c index c70761c..ebe84dd 100644 --- a/tests/test_config.c +++ b/tests/test_config.c @@ -8,10 +8,11 @@ enum { ACTION_NONE, ACTION_GET, ACTION_SET }; static void printUsage() { - printf( "Usage: test_config (-g)|(-s -m <model> -l <layouts> -o <options>)|(-h)\n" ); + printf( "Usage: test_config (-g)|(-s -m <model> -l <layouts> -o <options>)|(-h)(-d <debugLevel>)\n" ); printf( "Options:\n" ); printf( " -g - Dump the current config, load original system settings and revert back\n" ); printf( " -s - Set the configuration given my -m -l -o options. Similar to setxkbmap\n" ); + printf( " -d - Set the debug level (by default, 0)\n" ); printf( " -h - Show this help\n" ); } @@ -44,10 +45,11 @@ int main( int argc, char * const argv[] ) const char* model = NULL; const char* layouts = NULL; const char* options = NULL; + int debugLevel = 0; while (1) { - c = getopt( argc, argv, "hsgm:l:o:" ); + c = getopt( argc, argv, "hsgm:l:o:d:" ); if ( c == -1 ) break; switch (c) @@ -72,6 +74,9 @@ int main( int argc, char * const argv[] ) case 'h': printUsage(); exit(0); + case 'd': + debugLevel = atoi( optarg ); + break; default: fprintf( stderr, "?? getopt returned character code 0%o ??\n", c ); printUsage(); @@ -94,6 +99,7 @@ int main( int argc, char * const argv[] ) if ( !XklInit( dpy ) ) { XklConfigRec currentConfig, r2; + XklSetDebugLevel( debugLevel ); XklDebug( 0, "Xklavier initialized\n" ); XklConfigInit(); XklConfigLoadRegistry(); |