]> git.donarmstrong.com Git - mothur.git/blobdiff - quitcommand.cpp
added list parameter to get.seqs and remove.seqs and added readline library for inter...
[mothur.git] / quitcommand.cpp
index 6b90f4b15c1cf64ae04bed98db42138f0edcf2d7..99dc46be30ca9c282d82474e5021bdf4fc7f3c33 100644 (file)
 
 //**********************************************************************************************************************
 
-QuitCommand::QuitCommand(){}
+QuitCommand::QuitCommand(string option){
+               abort = false;
+               
+               //allow user to run help
+               if(option == "help") { help(); abort = true; }
+               
+               else if (option != "") { mothurOut("There are no valid parameters for the quit command."); mothurOutEndLine();  abort = true;  }
+
+}
+//**********************************************************************************************************************
+
+void QuitCommand::help(){
+       try {
+                mothurOut("The quit command will terminate mothur and should be in the following format: \n"); 
+                mothurOut("quit() or quit\n\n");
+       }
+       catch(exception& e) {
+               errorOut(e, "QuitCommand", "help");
+               exit(1);
+       }
+}
 
 //**********************************************************************************************************************
 
@@ -20,6 +40,7 @@ QuitCommand::~QuitCommand(){}
 //**********************************************************************************************************************
 
 int QuitCommand::execute(){
+       if (abort == true) { return 0; }
        return 1;
 }