summaryrefslogtreecommitdiff
path: root/src/cli/cli.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/cli.cpp')
-rw-r--r--src/cli/cli.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp
index 02e3306..d2eee4a 100644
--- a/src/cli/cli.cpp
+++ b/src/cli/cli.cpp
@@ -28,12 +28,6 @@
#include "cli.h"
#ifdef CLI
-
-#ifdef READLINE
-#include <readline/readline.h>
-#include <readline/history.h>
-#endif
-
using namespace std;
cli::cli( )
@@ -76,7 +70,7 @@ cli::parse_input( string s_input )
if ( s_input.compare("help") == 0 || s_input.compare("h") == 0)
{
cout << CLIPRMO << "COMMAND LINE INTERFACE HELP MENU" << endl
- << CLIPRMO << " !command - Uses system to run a command" << endl;
+ << CLIPRMO << " !command - Uses system to run a command" << endl;
#ifdef DEBUG
cout << CLIPRMO << " (d)ebug - Starts debug routine (cli.cpp)" << endl;
@@ -86,6 +80,11 @@ cli::parse_input( string s_input )
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
+
+ cout << CLIPRMO << " (ex)it - Quits CLI mode and respawns ncurses mode" << endl;
+#endif
+
cout << CLIPRMO << " (h)elp - Prints out this help!" << endl;
//<<*
cout << CLIPRMO << " (m)ysql - Runs MySQL client on yChat DB" << endl
@@ -100,7 +99,7 @@ cli::parse_input( string s_input )
<< CLIPRMO << " (ru)sageh - Shows resource usage history (yChat needs to run > 1 day)" << endl
<< CLIPRMO << " (set) VAR VAL - Sets configuration value VAR to VAL" << endl
<< CLIPRMO << " (sh)ell - Runs a system shell" << endl
- << CLIPRMO << " (shut)down - Shuts down the whole server" << endl
+ << CLIPRMO << " (s)hutdown - Shuts down the whole server" << endl
<< CLIPRMO << " (t)ime - Prints out time and uptime" << endl;
cout << CLIPRMO << " (unl)oad - Unloads all loaded modules" << endl;//<<
cout << CLIPRMO << " (u)nset VAR - Deletes configuration value VAR" << endl
@@ -181,6 +180,12 @@ cli::parse_input( string s_input )
}
//*>>
+#ifdef NCURSES
+ else if( s_input.compare("exit") == 0 || s_input.compare("ex") == 0 )
+ {
+ return 0;
+ }
+#endif
//<<*
else if( s_input.compare("reload") == 0 || s_input.compare("rel") == 0 )
@@ -321,6 +326,9 @@ cli::parse_input( string s_input )
void
cli::start(void* p_void)
+#else
+cli::start()
+#endif
{
cout << CLIPRMO << CLIWELC << endl;
@@ -343,6 +351,7 @@ cli::start(void* p_void)
if (!parse_input(s_input))
break;
}
+ while( parse_input(s_input) );
}
void
@@ -370,7 +379,7 @@ cli::print_rusage()
}
vector<string>
-cli::vectorize(string s_param)
+cli::vectorize(string s_param)
{
vector<string> vec_ret;
unsigned i_pos;