diff options
author | Klaus Kämpf <kkaempf@suse.de> | 2012-11-08 15:57:36 +0100 |
---|---|---|
committer | Klaus Kämpf <kkaempf@suse.de> | 2012-11-08 15:57:36 +0100 |
commit | e8a28f5f8b3adedf26cdab70f22538719fabb7f1 (patch) | |
tree | e909e3307acd9afb9d1850226c0e37de33fc86d2 | |
parent | 8eabac93232a7384614dff78b969620ef2b32162 (diff) | |
download | wsmancli-e8a28f5f8b3adedf26cdab70f22538719fabb7f1.tar.gz wsmancli-e8a28f5f8b3adedf26cdab70f22538719fabb7f1.tar.xz wsmancli-e8a28f5f8b3adedf26cdab70f22538719fabb7f1.zip |
Evaluate return value from u_option_context_parse()
-rw-r--r-- | src/wsman.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/wsman.c b/src/wsman.c index 0b4de46..a73697b 100644 --- a/src/wsman.c +++ b/src/wsman.c @@ -359,11 +359,16 @@ static char wsman_parse_options(int argc, char **argv) retval = u_option_context_parse(opt_ctx, &argc, &argv, &error); u_option_context_free(opt_ctx); - if (error) { + if (retval == 0) { + if (error) { if (error->message) - printf("%s\n", error->message); + fprintf(stderr, "%s\n", error->message); u_error_free(error); - return FALSE; + } + else { + fprintf(stderr, "Can't parse context information\n"); + } + return FALSE; } if (my_version) { |