Add --non-interactive option
diff --git a/ChangeLog b/ChangeLog
index 31b189e..0011734 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
- read credentials from environment
wsman: WSMAN_USER, WSMAN_PASS, WSMAN_EVENT_USER, WSMAN_EVENT_PASS
wseventmgr: WSEVENTMGR_USER, WSEVENTMGR_PASS, WSEVENTMGR_EVENT_USER, WSEVENTMGR_EVENT_PASS
+ - add --non-interactive cli parameter to prevent asking for credentials
Version 2.3.0
- don't crash on filter parse error (Zoltan Micskei)
diff --git a/man/wsman.1 b/man/wsman.1
index 4223a0d..54a72ef 100644
--- a/man/wsman.1
+++ b/man/wsman.1
@@ -31,6 +31,9 @@
.PP
Application Options
.TP
+\fB\-q\fR, \fB\-\-non-interactive\fR
+Don't ask for credentials interactively
+.TP
\fB\-q\fR, \fB\-\-version\fR
Display application version
.TP
diff --git a/src/wsman.c b/src/wsman.c
index 8660aaa..78b3689 100644
--- a/src/wsman.c
+++ b/src/wsman.c
@@ -76,6 +76,7 @@
static char *proxy_upwd = NULL;
+static long int non_interactive = 0;
static long int debug_level = -1;
static char *encoding = NULL;
static char *test_case = NULL;
@@ -181,6 +182,8 @@
char my_version = 0;
u_option_entry_t options[] = {
+ {"non-interactive", 0, U_OPTION_ARG_NONE, &non_interactive,
+ "Non interactive mode, don't ask for credentials", NULL},
{"version", 'q', U_OPTION_ARG_NONE, &my_version,
"Display application version", NULL},
{"debug", 'd', U_OPTION_ARG_INT, &debug_level,
@@ -675,8 +678,9 @@
password);
}
- wsmc_transport_set_auth_request_func(cl , &request_usr_pwd );
-
+ if (non_interactive == 0) {
+ wsmc_transport_set_auth_request_func(cl , &request_usr_pwd );
+ }
if (cl == NULL) {
error("Null Client");