mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 09:03:40 +02:00
2016-07-20 Fred Gleason <fredg@paravelsystems.com>
* Added a 'help' command to rdclilogedit(1) in 'utils/rdclilogedit/rdclilogedit.cpp'.
This commit is contained in:
@@ -15304,3 +15304,6 @@
|
||||
* Incremented the package version to 2.14.1int01.
|
||||
2016-07-20 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Stubbed out a command-line log editor in 'utils/rdclilogedit/'.
|
||||
2016-07-20 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added a 'help' command to rdclilogedit(1) in
|
||||
'utils/rdclilogedit/rdclilogedit.cpp'.
|
||||
|
@@ -134,6 +134,79 @@ void MainObject::inputActivatedData(int sock)
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Help(const QStringList &cmds) const
|
||||
{
|
||||
bool processed=false;
|
||||
|
||||
if(cmds.size()==1) {
|
||||
printf("\n");
|
||||
printf("The following commands are available:\n");
|
||||
printf("?, bye, exit, help, list, listlogs, load, quit, unload\n");
|
||||
printf("\n");
|
||||
printf("Enter \"? <cmd-name>\" for specific help.\n");
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
else {
|
||||
QString verb=cmds[1].lower();
|
||||
if((verb=="bye")||(verb=="exit")||(verb=="quit")) {
|
||||
printf("\n");
|
||||
printf(" %s\n",(const char *)cmds[1]);
|
||||
printf("\n");
|
||||
printf("Exit the program.\n");
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
if((verb=="?")||(verb=="help")) {
|
||||
printf("\n");
|
||||
printf(" %s <cmd-name>\n",(const char *)cmds[1]);
|
||||
printf("\n");
|
||||
printf("Print help about command <cmd-name>\n");
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
if(verb=="listlogs") {
|
||||
printf("\n");
|
||||
printf(" listlogs\n");
|
||||
printf("\n");
|
||||
printf("Print the list of Rivendell logs.\n");
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
if(verb=="load") {
|
||||
printf("\n");
|
||||
printf(" load <log-name>\n");
|
||||
printf("\n");
|
||||
printf("Load the <log-name> log into the edit buffer.\n");
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
if(verb=="unload") {
|
||||
printf("\n");
|
||||
printf(" unload\n");
|
||||
printf("\n");
|
||||
printf("Unload and clear the contents of the edit buffer.\n");
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
if(verb=="list") {
|
||||
printf("\n");
|
||||
printf(" list\n");
|
||||
printf("\n");
|
||||
printf("Print the contents of the edit buffer.\n");
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!processed) {
|
||||
printf("\n");
|
||||
printf("help: no such command\n");
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainObject::ListLogs() const
|
||||
{
|
||||
QString sql;
|
||||
@@ -207,6 +280,11 @@ void MainObject::DispatchCommand(const QString &cmd)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if((verb=="help")||(verb=="?")) {
|
||||
Help(cmds);
|
||||
processed=true;
|
||||
}
|
||||
|
||||
if(verb=="listlogs") {
|
||||
ListLogs();
|
||||
processed=true;
|
||||
|
@@ -45,6 +45,7 @@ class MainObject : public QObject
|
||||
void inputActivatedData(int sock);
|
||||
|
||||
private:
|
||||
void Help(const QStringList &cmds) const;
|
||||
void ListLogs() const;
|
||||
void Load(const QString &logname);
|
||||
void List();
|
||||
|
Reference in New Issue
Block a user