diff options
author | Matthew Newhook <matthew@zeroc.com> | 2008-02-29 15:51:11 +0800 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2008-02-29 16:39:54 +0800 |
commit | fb4132881dde7c9b135d713a06a3b64db1f706db (patch) | |
tree | 8a037e9d4cae7ed15360ab0878d14b32ac3150a4 /cpp/src/IceBox/Service.cpp | |
parent | fixing mode on php/config/Make.rules.mak (diff) | |
download | ice-fb4132881dde7c9b135d713a06a3b64db1f706db.tar.bz2 ice-fb4132881dde7c9b135d713a06a3b64db1f706db.tar.xz ice-fb4132881dde7c9b135d713a06a3b64db1f706db.zip |
Merge HA IceStorm branch.
- http://bugzilla/bugzilla/show_bug.cgi?id=2706
- http://bugzilla/bugzilla/show_bug.cgi?id=2705
Diffstat (limited to 'cpp/src/IceBox/Service.cpp')
-rw-r--r-- | cpp/src/IceBox/Service.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/cpp/src/IceBox/Service.cpp b/cpp/src/IceBox/Service.cpp index a66254e128d..83f2bda2bfe 100644 --- a/cpp/src/IceBox/Service.cpp +++ b/cpp/src/IceBox/Service.cpp @@ -45,14 +45,34 @@ IceBox::IceBoxService::IceBoxService() bool IceBox::IceBoxService::start(int argc, char* argv[]) { + // Run through the command line arguments removing all the service + // properties. + vector<string> args = Ice::argsToStringSeq(argc, argv); + PropertiesPtr properties = communicator()->getProperties(); + const string prefix = "IceBox.Service."; + PropertyDict services = properties->getPropertiesForPrefix(prefix); + for(PropertyDict::const_iterator p = services.begin(); p != services.end(); ++p) + { + string name = p->first.substr(prefix.size()); + StringSeq::iterator q = args.begin(); + while(q != args.end()) + { + if(q->find("--" + name + ".") == 0) + { + q = args.erase(q); + continue; + } + ++q; + } + } + IceUtilInternal::Options opts; opts.addOpt("h", "help"); opts.addOpt("v", "version"); - vector<string> args; try { - args = opts.parse(argc, (const char**)argv); + args = opts.parse(args); } catch(const IceUtilInternal::BadOptException& e) { |