From e06d37cb9691e52a1d76786221a10f02b5d30591 Mon Sep 17 00:00:00 2001 From: Peter Soetens Date: Wed, 15 Dec 2010 23:32:07 +0100 Subject: [PATCH] deployer: Don't pass/parse arguments behind the '--' mark. As such, we separate arguments for the deployer from arguments passed to os_init or any other middleware below (TAO,ROS,...) The middleware/transport can read the arguments after '--' with __os_main_argc() and __os_main_argv() from RTT::os. Signed-off-by: Peter Soetens --- bin/cdeployer.cpp | 2 +- bin/deployer-corba.cpp | 2 +- bin/deployer.cpp | 23 ++++++++++++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/bin/cdeployer.cpp b/bin/cdeployer.cpp index 6a5c6ae..16bf27b 100644 --- a/bin/cdeployer.cpp +++ b/bin/cdeployer.cpp @@ -142,7 +142,7 @@ int main(int argc, char** argv) #endif // start Orocos _AFTER_ setting up log4cpp - if (0 == __os_init(argc, argv)) + if (0 == __os_init(argc - taoIndex, &argv[taoIndex])) { // scope to force dc destruction prior to memory free { diff --git a/bin/deployer-corba.cpp b/bin/deployer-corba.cpp index 2f8cdb9..493bc67 100644 --- a/bin/deployer-corba.cpp +++ b/bin/deployer-corba.cpp @@ -144,7 +144,7 @@ int main(int argc, char** argv) #endif // start Orocos _AFTER_ setting up log4cpp - if (0 == __os_init(argc, argv)) + if (0 == __os_init(argc - taoIndex, &argv[taoIndex])) { rc = -1; // prove otherwise try { diff --git a/bin/deployer.cpp b/bin/deployer.cpp index 9f7991e..9674a2e 100644 --- a/bin/deployer.cpp +++ b/bin/deployer.cpp @@ -73,10 +73,27 @@ int main(int argc, char** argv) otherOptions.add(rttLog4cppOptions); #endif - int rc = OCL::deployerParseCmdLine(argc, argv, + // were we given non-deployer options? ie find "--" + int optIndex = 0; + bool found = false; + + while(!found && optIndex