diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-14 15:38:06 +0100 | 
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-14 15:38:06 +0100 | 
| commit | 77d77e5f4d60ed9d1f8346910f42fe2d61122f22 (patch) | |
| tree | eb18f097815e2b5b3b76cf521d7aa06e54a053f0 /src | |
| parent | 4249e4a53950457394395555cd7dcdd6287b499b (diff) | |
| download | dabmux-77d77e5f4d60ed9d1f8346910f42fe2d61122f22.tar.gz dabmux-77d77e5f4d60ed9d1f8346910f42fe2d61122f22.tar.bz2 dabmux-77d77e5f4d60ed9d1f8346910f42fe2d61122f22.zip  | |
RemoteControl: make only one list command
Diffstat (limited to 'src')
| -rw-r--r-- | src/RemoteControl.cpp | 27 | 
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 {  | 
