add --print-channels to print registered channels of the device

This commit is contained in:
Alexey Rybalchenko
2017-06-20 15:58:43 +02:00
committed by Mohammad Al-Turany
parent 1d38a2350f
commit 4bc54ad32b
8 changed files with 68 additions and 10 deletions

View File

@@ -24,6 +24,14 @@
template<typename TMQDevice>
inline int runStateMachine(TMQDevice& device, FairMQProgOptions& cfg)
{
device.RegisterChannelEndpoints();
if (cfg.GetValue<bool>("print-channels"))
{
device.PrintRegisteredChannels();
device.ChangeState(TMQDevice::END);
return 0;
}
if (cfg.GetValue<int>("catch-signals") > 0)
{
device.CatchSignals();
@@ -33,6 +41,8 @@ inline int runStateMachine(TMQDevice& device, FairMQProgOptions& cfg)
LOG(WARN) << "Signal handling (e.g. ctrl+C) has been deactivated via command line argument";
}
LOG(DEBUG) << "PID: " << getpid();
device.SetConfig(cfg);
std::string config = cfg.GetValue<std::string>("config");
std::string control = cfg.GetValue<std::string>("control");