]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.cpp
added checks for ^C to quit command instead of program
[mothur.git] / mothur.cpp
index 7cd77a1c2fd8fec087e740a7340f4a74c19ea801..a3eef76a2766d5ae69c824b0ee4cf4b5e3f14a51 100644 (file)
@@ -24,6 +24,13 @@ void ctrlc_handler ( int sig ) {
        MothurOut* m = MothurOut::getInstance();
     ctrlc_pressed = 1;
        m->control_pressed = ctrlc_pressed;
+       
+       if (m->executing) { //if mid command quit execution, else quit mothur
+               m->mothurOutEndLine(); m->mothurOut("quitting command...");  m->mothurOutEndLine();
+       }else{
+               m->mothurOut("quitting mothur");  m->mothurOutEndLine();
+               exit(1);
+       }
 }
 /***********************************************************************/
 int main(int argc, char *argv[]){