diff options
author | Antonio Ospite <ao2@ao2.it> | 2014-08-11 13:18:19 +0200 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2016-01-22 09:58:29 -0600 |
commit | 32eaea94a3b19ad3c6b7fcff5fec94454fbfd97f (patch) | |
tree | ffd8226d84bb1cb9e446b1a776f8ff7b58170026 | |
parent | 51abfc03dd1f0f1904455b703106abe19a062eec (diff) | |
download | libgnomekbd-32eaea94a3b19ad3c6b7fcff5fec94454fbfd97f.tar.gz |
test/gkbd-keyboard-drawing-test.c: bail out when option parsing fails
https://bugzilla.gnome.org/show_bug.cgi?id=734619
-rw-r--r-- | test/gkbd-keyboard-drawing-test.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/gkbd-keyboard-drawing-test.c b/test/gkbd-keyboard-drawing-test.c index 3e05d5f..3a2f7f2 100644 --- a/test/gkbd-keyboard-drawing-test.c +++ b/test/gkbd-keyboard-drawing-test.c @@ -164,6 +164,7 @@ main (gint argc, gchar ** argv) gint monitor; GdkRectangle rect; GOptionContext *context; + GError *error = NULL; GkbdKeyboardDrawingGroupLevel groupLevels[4] = { {0, 0}, {1, 0}, {0, 1}, {1, 1} }; @@ -174,7 +175,11 @@ main (gint argc, gchar ** argv) context = g_option_context_new ("kbdraw"); g_option_context_add_main_entries (context, options, NULL); - g_option_context_parse (context, &argc, &argv, NULL); + if (!g_option_context_parse (context, &argc, &argv, &error)) { + g_message ("option parsing failed: %s", error->message); + g_option_context_free (context); + exit (EXIT_FAILURE); + } g_option_context_free (context); if (program_version) { |