summaryrefslogtreecommitdiffstats
path: root/src/wsman.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wsman.c')
-rw-r--r--src/wsman.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/wsman.c b/src/wsman.c
index effd19e..0ab6a17 100644
--- a/src/wsman.c
+++ b/src/wsman.c
@@ -179,8 +179,11 @@ static char wsman_parse_options(int argc, char **argv)
{
char retval = 0;
u_error_t *error = NULL;
+ char my_version = 0;
u_option_entry_t options[] = {
+ {"version", 'q', U_OPTION_ARG_NONE, &my_version,
+ "Display application version", NULL},
{"debug", 'd', U_OPTION_ARG_INT, &debug_level,
"Set the verbosity of debugging output.", "1-6"},
{"encoding", 'j', U_OPTION_ARG_STRING, &encoding,
@@ -366,6 +369,11 @@ static char wsman_parse_options(int argc, char **argv)
return FALSE;
}
+ if (my_version) {
+ fprintf(stdout, PACKAGE_STRING " (" PACKAGE_BUILDTS ")\n\n");
+ exit(0);
+ }
+
if (argc > 2) {
_action = argv[1];
resource_uri_opt = argv[2];
@@ -837,7 +845,6 @@ int main(int argc, char **argv)
enumContext = wsmc_get_enum_context(enum_response);
ws_xml_destroy_doc(enum_response);
} else {
- u_free(enumContext);
break;
}
@@ -852,7 +859,6 @@ int main(int argc, char **argv)
if (wsmc_get_response_code(cl) != 200
&& wsmc_get_response_code(cl) != 400
&& wsmc_get_response_code(cl) != 500) {
- u_free(enumContext);
break;
}
u_free(enumContext);