Skip to content

Commit

Permalink
Add --non-interactive option
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaempf committed Feb 26, 2014
1 parent c767686 commit 6f94776
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Version 2.3.1
- 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)
Expand Down
3 changes: 3 additions & 0 deletions man/wsman.1
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Subscription Options
.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
Expand Down
8 changes: 6 additions & 2 deletions src/wsman.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ static char *proxy = NULL;
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;
Expand Down Expand Up @@ -181,6 +182,8 @@ static char wsman_parse_options(int argc, char **argv)
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,
Expand Down Expand Up @@ -675,8 +678,9 @@ int main(int argc, char **argv)
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");
Expand Down

0 comments on commit 6f94776

Please sign in to comment.