summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKlaus Kaempf <kkaempf@novell.com>2010-02-20 08:32:43 +0000
committerKlaus Kaempf <kkaempf@novell.com>2010-02-20 08:32:43 +0000
commit392d7eb5fae3c029fbdeef2bd79ab96db18e72a3 (patch)
tree958c42ff3481bcb923ff1e3e37ab85b522ca8604 /src
parentc4eaa3ef3711f4f0caa8fc0d5021cf31d49927b8 (diff)
downloadwsmancli-392d7eb5fae3c029fbdeef2bd79ab96db18e72a3.tar.gz
wsmancli-392d7eb5fae3c029fbdeef2bd79ab96db18e72a3.tar.xz
wsmancli-392d7eb5fae3c029fbdeef2bd79ab96db18e72a3.zip
add ChangeLog
add --version to wsman to print version and build timestamp
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am3
-rw-r--r--src/wsman.c10
2 files changed, 10 insertions, 3 deletions
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);