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:
Fred Gleason
2016-07-20 16:32:34 -04:00
parent 0402781e01
commit e83ba7317a
3 changed files with 82 additions and 0 deletions

View File

@@ -15304,3 +15304,6 @@
* Incremented the package version to 2.14.1int01. * Incremented the package version to 2.14.1int01.
2016-07-20 Fred Gleason <fredg@paravelsystems.com> 2016-07-20 Fred Gleason <fredg@paravelsystems.com>
* Stubbed out a command-line log editor in 'utils/rdclilogedit/'. * 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'.

View File

@@ -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 void MainObject::ListLogs() const
{ {
QString sql; QString sql;
@@ -207,6 +280,11 @@ void MainObject::DispatchCommand(const QString &cmd)
exit(0); exit(0);
} }
if((verb=="help")||(verb=="?")) {
Help(cmds);
processed=true;
}
if(verb=="listlogs") { if(verb=="listlogs") {
ListLogs(); ListLogs();
processed=true; processed=true;

View File

@@ -45,6 +45,7 @@ class MainObject : public QObject
void inputActivatedData(int sock); void inputActivatedData(int sock);
private: private:
void Help(const QStringList &cmds) const;
void ListLogs() const; void ListLogs() const;
void Load(const QString &logname); void Load(const QString &logname);
void List(); void List();