You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2013/04/18 19:18:12 UTC

svn commit: r1469466 - in /qpid/trunk/qpid/cpp: include/qpid/Options.h src/posix/QpiddBroker.cpp

Author: astitcher
Date: Thu Apr 18 17:18:11 2013
New Revision: 1469466

URL: http://svn.apache.org/r1469466
Log:
QPID-3689: Fix previous change of command line option handling
Now introduced new command line option type that is a pure command
line switch which can take no boolean argument.

Modified:
    qpid/trunk/qpid/cpp/include/qpid/Options.h
    qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp

Modified: qpid/trunk/qpid/cpp/include/qpid/Options.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/Options.h?rev=1469466&r1=1469465&r2=1469466&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/Options.h (original)
+++ qpid/trunk/qpid/cpp/include/qpid/Options.h Thu Apr 18 17:18:11 2013
@@ -98,6 +98,10 @@ inline po::value_semantic* optValue(bool
 #endif
 }
 
+inline po::value_semantic* pure_switch(bool& value) {
+    return po::bool_switch(&value);
+}
+
 /**
  * Base class for options.
  * Example of use:

Modified: qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp?rev=1469466&r1=1469465&r2=1469466&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp (original)
+++ qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp Thu Apr 18 17:18:11 2013
@@ -75,12 +75,12 @@ struct DaemonOptions : public qpid::Opti
         piddir += "/.qpidd";
 
         addOptions()
-            ("daemon,d", optValue(daemon), "Run as a daemon. Logs to syslog by default in this mode.")
+            ("daemon,d", pure_switch(daemon), "Run as a daemon. Logs to syslog by default in this mode.")
             ("transport", optValue(transport, "TRANSPORT"), "The transport for which to return the port")
             ("pid-dir", optValue(piddir, "DIR"), "Directory where port-specific PID file is stored")
             ("wait,w", optValue(wait, "SECONDS"), "Sets the maximum wait time to initialize the daemon. If the daemon fails to initialize, prints an error and returns 1")
-            ("check,c", optValue(check), "Prints the daemon's process ID to stdout and returns 0 if the daemon is running, otherwise returns 1")
-            ("quit,q", optValue(quit), "Tells the daemon to shut down");
+            ("check,c", pure_switch(check), "Prints the daemon's process ID to stdout and returns 0 if the daemon is running, otherwise returns 1")
+            ("quit,q", pure_switch(quit), "Tells the daemon to shut down");
     }
 };
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org