2016-07-20 Fred Gleason <fredg@paravelsystems.com>

* Added a 'remove' command to rdclilogedit(1) in
	'utils/rdclilogedit/rdclilogedit.cpp' and
	'utils/rdclilogedit/rdclilogedit.h'.
This commit is contained in:
Fred Gleason
2016-07-20 18:40:10 -04:00
parent 27e3113f27
commit a166e4f731
4 changed files with 37 additions and 2 deletions

View File

@@ -214,6 +214,12 @@ void MainObject::List()
}
void MainObject::Remove(int line)
{
edit_log_event->remove(line,1);
}
void MainObject::Save()
{
if(edit_log_event==NULL) {
@@ -371,6 +377,22 @@ void MainObject::DispatchCommand(const QString &cmd)
processed=true;
}
if(verb=="remove") {
if(cmds.size()==2) {
line=cmds[1].toInt(&ok);
if(ok&&(line>=0)&&(line<edit_log_event->size())) {
Remove(line);
}
else {
fprintf(stderr,"remove: invalid line number\n");
}
}
else {
fprintf(stderr,"remove: invalid command arguments\n");
}
processed=true;
}
if(verb=="save") {
Save();
processed=true;