]> git.donarmstrong.com Git - mothur.git/blob - quitcommand.cpp
created mothurOut class to handle logfiles
[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 }
21 //**********************************************************************************************************************
22
23 void QuitCommand::help(){
24         try {
25                  m->mothurOut("The quit command will terminate mothur and should be in the following format: \n"); 
26                  m->mothurOut("quit() or quit\n\n");
27         }
28         catch(exception& e) {
29                 m->errorOut(e, "QuitCommand", "help");
30                 exit(1);
31         }
32 }
33
34 //**********************************************************************************************************************
35
36 QuitCommand::~QuitCommand(){}
37
38 //**********************************************************************************************************************
39
40 int QuitCommand::execute(){
41         if (abort == true) { return 0; }
42         return 1;
43 }
44
45 //**********************************************************************************************************************