]> git.donarmstrong.com Git - mothur.git/blobdiff - quitcommand.cpp
added clearcut source to mothur, fixed mislabeled sharedcalcs
[mothur.git] / quitcommand.cpp
index 6b90f4b15c1cf64ae04bed98db42138f0edcf2d7..8e6fd15412167f9b2ae26eec7b9d93a8e19c6bd2 100644 (file)
 
 //**********************************************************************************************************************
 
-QuitCommand::QuitCommand(){}
+QuitCommand::QuitCommand(string option) {
+               abort = false;
+               
+               //allow user to run help
+               if(option == "help") { help(); abort = true; }
+
+}
+//**********************************************************************************************************************
+
+void QuitCommand::help(){
+       try {
+                m->mothurOut("The quit command will terminate mothur and should be in the following format: \n"); 
+                m->mothurOut("quit() or quit\n\n");
+       }
+       catch(exception& e) {
+               m->errorOut(e, "QuitCommand", "help");
+               exit(1);
+       }
+}
 
 //**********************************************************************************************************************
 
@@ -20,6 +38,7 @@ QuitCommand::~QuitCommand(){}
 //**********************************************************************************************************************
 
 int QuitCommand::execute(){
+       if (abort == true) { return 0; }
        return 1;
 }