aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-02-14 15:38:06 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-02-14 15:38:06 +0100
commit77d77e5f4d60ed9d1f8346910f42fe2d61122f22 (patch)
treeeb18f097815e2b5b3b76cf521d7aa06e54a053f0
parent4249e4a53950457394395555cd7dcdd6287b499b (diff)
downloaddabmux-77d77e5f4d60ed9d1f8346910f42fe2d61122f22.tar.gz
dabmux-77d77e5f4d60ed9d1f8346910f42fe2d61122f22.tar.bz2
dabmux-77d77e5f4d60ed9d1f8346910f42fe2d61122f22.zip
RemoteControl: make only one list command
-rw-r--r--src/RemoteControl.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp
index 2987960..3c1c24a 100644
--- a/src/RemoteControl.cpp
+++ b/src/RemoteControl.cpp
@@ -108,9 +108,7 @@ RemoteControllerTelnet::dispatch_command(tcp::socket& socket, string command)
reply(socket,
"The following commands are supported:\n"
" list\n"
- " * Lists the modules that are loaded\n"
- " list MODULE\n"
- " * Lists the parameters exported by module MODULE\n"
+ " * Lists the modules that are loaded and their parameters\n"
" show MODULE\n"
" * Lists all parameters and their values from module MODULE\n"
" get MODULE PARAMETER\n"
@@ -127,22 +125,15 @@ RemoteControllerTelnet::dispatch_command(tcp::socket& socket, string command)
if (cmd.size() == 1) {
for (list<RemoteControllable*>::iterator it = m_cohort.begin();
it != m_cohort.end(); ++it) {
- ss << (*it)->get_rc_name() << " ";
- }
- }
- else if (cmd.size() == 2) {
- try {
- stringstream ss;
-
- list< vector<string> > params = get_parameter_descriptions_(cmd[1]);
- for (list< vector<string> >::iterator it = params.begin();
- it != params.end(); ++it) {
- ss << (*it)[0] << " : " << (*it)[1] << endl;
+ ss << (*it)->get_rc_name() << endl;
+
+ list< vector<string> >::iterator param;
+ list< vector<string> > params = (*it)->get_parameter_descriptions();
+ for (param = params.begin();
+ param != params.end();
+ ++param) {
+ ss << "\t" << (*param)[0] << " : " << (*param)[1] << endl;
}
- reply(socket, ss.str());
- }
- catch (ParameterError &e) {
- reply(socket, e.what());
}
}
else {