From 77d77e5f4d60ed9d1f8346910f42fe2d61122f22 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 14 Feb 2014 15:38:06 +0100 Subject: RemoteControl: make only one list command --- src/RemoteControl.cpp | 27 +++++++++------------------ 1 file 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::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 > params = get_parameter_descriptions_(cmd[1]); - for (list< vector >::iterator it = params.begin(); - it != params.end(); ++it) { - ss << (*it)[0] << " : " << (*it)[1] << endl; + ss << (*it)->get_rc_name() << endl; + + list< vector >::iterator param; + list< vector > 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 { -- cgit v1.2.3