Update of /cvsroot/sblim/wbemcli
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5719
Modified Files:
ChangeLog CimCurl.cpp NEWS main.cpp
Log Message:
Fixed 0002627: Add -w option to wbemcli
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/wbemcli/NEWS,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- NEWS 25 Mar 2013 04:05:49 -0000 1.45
+++ NEWS 25 Mar 2013 04:38:45 -0000 1.46
@@ -5,6 +5,8 @@
- 3519016 wbemcli does not support EmbeddedObject attr of PARAMVALUE
- 3514126 wbemcli does not compile with GCC 4.7
- 3495602 Fix for ID 3202420 (CDATA escape) breaks cim clients
+- 0002626 - Add IPv6 LLA support to wbemcli
+- 0002627 - Add -w option to wbemcli
Changes in Version 1.6.2
========================
@@ -13,7 +15,6 @@
- 3324380 support optional CIMType in KEYVALUE element
- 3216622 wbemcli throws parser error on CDATA string value
- 2991546 Core dumps when property contains value within "[]"
-- 0002626 Add IPv6 LLA support to wbemcli
Changes in Version 1.6.1
========================
Index: main.cpp
===================================================================
RCS file: /cvsroot/sblim/wbemcli/main.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- main.cpp 24 Jun 2009 17:44:48 -0000 1.34
+++ main.cpp 25 Mar 2013 04:38:45 -0000 1.35
@@ -61,14 +61,14 @@
extern int openwbem;
extern int dlmRefs;
extern int reqChunking;
-
+int waitTime;
static void usage(int indir, int op, char *cmd)
{
cerr<<"usage:";
cerr<<"\twbemcli gc|gcd|dc|ec|ecn|gi|ci|mi|di|ei|ein|ain|ai|rin|ri|gp|sp|cm|cmx\n"
- "\t [-nl] [-dx] [-t] [-cte] [-h] [-v]\n"
+ "\t [-nl] [-dx] [-t] [-cte] [-h] [-v] [-w <waittime>]\n"
"\t [-noverify] [-cacert <file>] [-clientcert <file>] [-clientkey <file>]\n"
"\t [-ac <assocClass>] [-arc <resultClass>] [-ar <role>] [-arr <resultRole>]\n"
"\t objectPath [prop=value,[...]] [props[,...]]\n"<<endl;
@@ -117,7 +117,7 @@
int main (int argc, char *argv[]) {
int pos, retval = 0;
- char *cmd, *params, *opStr=NULL,*urlStr=NULL,*xtraStr=NULL;
+ char *cmd, *params, *endptr, *opStr=NULL,*urlStr=NULL,*xtraStr=NULL;
char *assocClass=NULL,*resultClass=NULL,*role=NULL,*resultRole=NULL;
const char *cacert=CACERT, *clientcert=NULL, *clientkey=NULL;
int n=1,err=0,op=0,cmdln,help=0,indir=0, noverify=0;
@@ -200,6 +200,10 @@
else if (strcmp(*argv,"-arc")==0) resultClass=*(++argv);
else if (strcmp(*argv,"-ar")==0) role=*(++argv);
else if (strcmp(*argv,"-arr")==0) resultRole=*(++argv);
+ else if (strcmp(*argv,"-w")==0) {
+ waitTime = (int) strtol(*(++argv),&endptr,0);
+ if (endptr == *argv) err=1; // no digits found
+ }
else if (strcmp(*argv,"-v")==0) {
cerr<<"* wbemcli Version " PACKAGE_VERSION ", $Date$" <<endl;
goto fini;
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/wbemcli/ChangeLog,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- ChangeLog 25 Mar 2013 04:05:49 -0000 1.38
+++ ChangeLog 25 Mar 2013 04:38:45 -0000 1.39
@@ -1,5 +1,11 @@
2013-03-25 Dave Heller <hel...@us...>
+ * CimCurl.cpp, main.cpp, NEWS:
+
+ Fixed 0002627: Add -w option to wbemcli
+
+2013-03-25 Dave Heller <hel...@us...>
+
* CimCurl.cpp, CimXml.cpp, CimXml.h, NEWS:
Fixed 0002626: Add IPv6 LLA support to wbemcli
Index: CimCurl.cpp
===================================================================
RCS file: /cvsroot/sblim/wbemcli/CimCurl.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- CimCurl.cpp 25 Mar 2013 04:05:49 -0000 1.15
+++ CimCurl.cpp 25 Mar 2013 04:38:45 -0000 1.16
@@ -33,6 +33,7 @@
extern int useNl;
extern int dumpXml;
extern int reqChunking;
+extern int waitTime;
// These are the constant headers added to all requests
static const char *headers[] = {
@@ -289,6 +290,17 @@
if (response.length() == 0)
throw HttpException("No data received from server.");
+ // This is not ideal as we have the response but wait to return it.
+ // However it is much simpler to implement this here.
+ if (waitTime > 0) {
+ printf("waiting %ds...\n", waitTime);
+ sleep(waitTime);
+ }
+ else if (waitTime < 0) {
+ waitTime = (int) -1;
+ printf("waiting forever...\n");
+ sleep(-1);
+ }
return response;
}
|