|
@@ -40,6 +40,7 @@ void Interface::initalize() {
|
|
|
this->swordLibrary = new sword::SWMgr(new sword::MarkupFilterMgr
|
|
|
(sword::FMT_PLAIN));
|
|
|
std::cout << "Initalized, proceeding to shell..." << std::endl;
|
|
|
+// this->display = new Display;
|
|
|
}
|
|
|
|
|
|
void Interface::configLines() {
|
|
@@ -185,21 +186,38 @@ std::string Interface::processCommand(std::string command) {
|
|
|
Search searcher;
|
|
|
Pager resultsPager;
|
|
|
std::list<page> pagedResults;
|
|
|
- std::string results;
|
|
|
+ std::string results = "";
|
|
|
+ std::string searchTerms = "";
|
|
|
|
|
|
resultsPager.setSize(display.getSize());
|
|
|
|
|
|
searcher.setSwordLibrary(this->swordLibrary);
|
|
|
searcher.setModule(selectedVersion);
|
|
|
+ searcher.setDisplay(display);
|
|
|
|
|
|
+ //If no argument is provided to the command, propmpt for the
|
|
|
+ //search terms, otherwise recombine the arguments into a string
|
|
|
+ if (parsedCommand.empty()) {
|
|
|
+ display.displayHeader();
|
|
|
+ display.displaySpacer(2);
|
|
|
+ std::cout << "Enter a word or phrase to search for: ";
|
|
|
+ std::getline(std::cin,searchTerms);
|
|
|
+
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ searchTerms = parsedCommand.front();
|
|
|
+ }
|
|
|
+
|
|
|
//TODO: Make this more than references or an option to do text or
|
|
|
//reference results or both.
|
|
|
- results = searcher.search("Jesus");
|
|
|
+ results = searcher.search(searchTerms);
|
|
|
pagedResults = resultsPager.getPagedText(results);
|
|
|
|
|
|
+ display.clearScreen();
|
|
|
+ display.displayHeader();
|
|
|
display.displayPages(pagedResults);
|
|
|
|
|
|
- return command;
|
|
|
+ return commandPart;
|
|
|
}
|
|
|
else {
|
|
|
std::cerr << "Error: No Module Selected" << std::endl;
|