diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:48 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:48 +0200 |
| commit | 5a019f435eb0068b524566d9babf172d58d0e96e (patch) | |
| tree | b083dccdfbec4335a5967d50c4294f7501c77345 /src/cli/cli.cpp | |
| parent | 4ecbf33fae730bc79c4a47e6efda615b104754ad (diff) | |
tagging ychat-0.7.9.2ychat-0.7.9.2
Diffstat (limited to 'src/cli/cli.cpp')
| -rwxr-xr-x | src/cli/cli.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 96a0010..cc0f5e5 100755 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -37,6 +37,8 @@ cli::parse_input( string s_input ) cout << CLIPRMO << " (d)ebug - Starts debug routine (cli.cpp)" << endl; #endif + cout << CLIPRMO << " (du)mp [part] - Prints out a dump of the data structure" << endl; + cout << CLIPRMO << " (Run without part to list all possibilities)" << endl; cout << CLIPRMO << " (e)cho VAR - Prints out configuration value of VAR" << endl; cout << CLIPRMO << " Wildcards can be used too, example: echo http*" << endl; #ifdef NCURSES @@ -78,6 +80,11 @@ cli::parse_input( string s_input ) cout << CLIPRMI; } #endif + else if ( s_input.compare("du") == 0 || s_input.compare("dump") == 0 ) + { + dump d(vectorize(s_param)); + cout << CLIPRMI; + } else if( s_input.compare("echo") == 0 || s_input.compare("e") == 0 ) { string s_val; @@ -134,6 +141,7 @@ cli::parse_input( string s_input ) { cout << CLIPRMO; wrap::MODL->reload_modules(); + cout << MODRELO << endl; cout << CLIPRMI; } //*>> @@ -207,6 +215,7 @@ cli::parse_input( string s_input ) { cout << CLIPRMO; wrap::MODL->unload_modules(); + cout << MODUNLO << endl; cout << CLIPRMI; } //*>> @@ -285,6 +294,26 @@ cli::print_rusage() delete p_rusage; } +vector<string> +cli::vectorize(string s_param) +{ + vector<string> vec_ret; + unsigned i_pos; + + for (i_pos = s_param.find(" "); + i_pos != string::npos; + i_pos = s_param.find(" ")) + { + vec_ret.push_back(s_param.substr(0, i_pos)); + s_param = s_param.substr(i_pos+1); + } + + if (!s_param.empty()) + vec_ret.push_back(s_param); + + return vec_ret; +} + #ifdef DEBUG void cli::debug_routine() |
