diff options
author | Gordon Sim <gsim@apache.org> | 2006-12-06 08:11:57 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2006-12-06 08:11:57 +0000 |
commit | 905c59a988010c9db7f64ee90f9d0b6e1011f0d0 (patch) | |
tree | 60bfef5035aea1284d1d216de2c57ebd8ba9063f /cpp/lib/broker/Configuration.h | |
parent | 7ece6a3212f401f5ce298e01728f939e670dc4d9 (diff) | |
download | qpid-python-905c59a988010c9db7f64ee90f9d0b6e1011f0d0.tar.gz |
Patch sumbitted to qpid-dev:
2006-12-05 Jim Meyering <meyering@redhat.com>
Improve --help output. Add --version option.
* lib/broker/Configuration.cpp: Include <config.h>.
(Configuration::Configuration): Use the active voice.
Handle --version.
(Configuration::usage): Add Usage:... and bug-reporting address.
Output short+long options like "-o, --option ...", so that help2man
will format them properly.
* lib/broker/Configuration.h:
(class Configuration) [version, programName]: New members.
(parse): Update prototype.
(isVersion, setValue): New prototypes.
* src/qpidd.cpp: Include <config.h>.
(programName): New file-scoped global.
(handle_signal, main): Emit diagnostics to stderr.
(main): Pass program name to config.parse.
(main): Handle new --version option.
Also updated ConfigurationTest to use the modified parse() method.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@482958 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/broker/Configuration.h')
-rw-r--r-- | cpp/lib/broker/Configuration.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/lib/broker/Configuration.h b/cpp/lib/broker/Configuration.h index 1dfc191018..3f2ffd1662 100644 --- a/cpp/lib/broker/Configuration.h +++ b/cpp/lib/broker/Configuration.h @@ -97,6 +97,8 @@ namespace qpid { IntOption connectionBacklog; StringOption store; BoolOption help; + BoolOption version; + char const *programName; typedef std::vector<Option*>::iterator op_iterator; std::vector<Option*> options; @@ -111,9 +113,10 @@ namespace qpid { Configuration(); ~Configuration(); - void parse(int argc, char** argv); + void parse(char const*, int argc, char** argv); bool isHelp() const; + bool isVersion() const; bool isTrace() const; int getPort() const; int getWorkerThreads() const; @@ -122,6 +125,7 @@ namespace qpid { const std::string& getStore() const; void setHelp(bool b) { help.setValue(b); } + void setVersion(bool b) { version.setValue(b); } void setTrace(bool b) { trace.setValue(b); } void setPort(int i) { port.setValue(i); } void setWorkerThreads(int i) { workerThreads.setValue(i); } |