diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-05-30 13:00:46 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-03 16:08:56 +0200 |
commit | d3c55d2a7dc02b5dd1ad65029ce40c28ba185eef (patch) | |
tree | a3b977c677dabc479c8df1182c529409ff008f2a /cli | |
parent | 0aa65b2b8eb974ed098cf4f341f99f8ca84bf4c8 (diff) | |
download | external_libqmi-d3c55d2a7dc02b5dd1ad65029ce40c28ba185eef.zip external_libqmi-d3c55d2a7dc02b5dd1ad65029ce40c28ba185eef.tar.gz external_libqmi-d3c55d2a7dc02b5dd1ad65029ce40c28ba185eef.tar.bz2 |
cli: exit with error if failed parsing input arguments
Diffstat (limited to 'cli')
-rw-r--r-- | cli/qmicli.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/qmicli.c b/cli/qmicli.c index f91907d..5029d1b 100644 --- a/cli/qmicli.c +++ b/cli/qmicli.c @@ -328,6 +328,7 @@ device_new_ready (GObject *unused, int main (int argc, char **argv) { + GError *error = NULL; GFile *file; GOptionContext *context; @@ -342,7 +343,11 @@ int main (int argc, char **argv) g_option_context_add_group (context, qmicli_wds_get_option_group ()); g_option_context_add_main_entries (context, main_entries, NULL); - g_option_context_parse (context, &argc, &argv, NULL); + if (!g_option_context_parse (context, &argc, &argv, &error)) { + g_printerr ("error: %s\n", + error->message); + exit (EXIT_FAILURE); + } g_option_context_free (context); if (version_flag) |