summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/include/qpid/Options.h4
-rw-r--r--qpid/cpp/src/posix/QpiddBroker.cpp6
2 files changed, 7 insertions, 3 deletions
diff --git a/qpid/cpp/include/qpid/Options.h b/qpid/cpp/include/qpid/Options.h
index 993e024f3d..6c908518b8 100644
--- a/qpid/cpp/include/qpid/Options.h
+++ b/qpid/cpp/include/qpid/Options.h
@@ -98,6 +98,10 @@ inline po::value_semantic* optValue(bool& value) {
#endif
}
+inline po::value_semantic* pure_switch(bool& value) {
+ return po::bool_switch(&value);
+}
+
/**
* Base class for options.
* Example of use:
diff --git a/qpid/cpp/src/posix/QpiddBroker.cpp b/qpid/cpp/src/posix/QpiddBroker.cpp
index a681a6d18d..dc6766d34f 100644
--- a/qpid/cpp/src/posix/QpiddBroker.cpp
+++ b/qpid/cpp/src/posix/QpiddBroker.cpp
@@ -75,12 +75,12 @@ struct DaemonOptions : public qpid::Options {
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");
}
};