]> git.donarmstrong.com Git - mothur.git/blob - quitcommand.cpp
added logfile feature
[mothur.git] / quitcommand.cpp
1 /*
2  *  quitcommand.cpp
3  *  Dotur
4  *
5  *  Created by Sarah Westcott on 1/2/09.
6  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "quitcommand.h"
11
12 //**********************************************************************************************************************
13
14 QuitCommand::QuitCommand(string option){
15                 abort = false;
16                 
17                 //allow user to run help
18                 if(option == "help") { help(); abort = true; }
19                 
20                 else if (option != "") { mothurOut("There are no valid parameters for the quit command."); mothurOutEndLine();  abort = true;  }
21
22 }
23 //**********************************************************************************************************************
24
25 void QuitCommand::help(){
26         try {
27                  mothurOut("The quit command will terminate mothur and should be in the following format: \n"); 
28                  mothurOut("quit() or quit\n\n");
29         }
30         catch(exception& e) {
31                 errorOut(e, "QuitCommand", "help");
32                 exit(1);
33         }
34 }
35
36 //**********************************************************************************************************************
37
38 QuitCommand::~QuitCommand(){}
39
40 //**********************************************************************************************************************
41
42 int QuitCommand::execute(){
43         if (abort == true) { return 0; }
44         return 1;
45 }
46
47 //**********************************************************************************************************************