From 392d7eb5fae3c029fbdeef2bd79ab96db18e72a3 Mon Sep 17 00:00:00 2001 From: Klaus Kaempf Date: Sat, 20 Feb 2010 08:32:43 +0000 Subject: add ChangeLog add --version to wsman to print version and build timestamp --- src/Makefile.am | 3 ++- src/wsman.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index c34591c..370e8e7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,8 @@ AM_CFLAGS = @CFLAGS@ CFLAGS = \ - $(OPENWSMAN_CFLAGS) + $(OPENWSMAN_CFLAGS) \ + -DPACKAGE_BUILDTS=\"$(PACKAGE_BUILDTS)\" wsman_LDADD = \ $(OPENWSMAN_LIBS) \ 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); -- cgit