]> git.donarmstrong.com Git - mothur.git/blob - quitcommand.cpp
added pipeline commands which involved change to command factory and command class...
[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 vector<string> QuitCommand::getValidParameters(){       
14         try {
15                 vector<string> myArray; 
16                 return myArray;
17         }
18         catch(exception& e) {
19                 m->errorOut(e, "QuitCommand", "getValidParameters");
20                 exit(1);
21         }
22 }
23 //**********************************************************************************************************************
24 vector<string> QuitCommand::getRequiredParameters(){    
25         try {
26                 vector<string> myArray;
27                 return myArray;
28         }
29         catch(exception& e) {
30                 m->errorOut(e, "QuitCommand", "getRequiredParameters");
31                 exit(1);
32         }
33 }
34 //**********************************************************************************************************************
35 vector<string> QuitCommand::getRequiredFiles(){ 
36         try {
37                 vector<string> myArray;
38                 return myArray;
39         }
40         catch(exception& e) {
41                 m->errorOut(e, "QuitCommand", "getRequiredFiles");
42                 exit(1);
43         }
44 }
45 //**********************************************************************************************************************
46
47 QuitCommand::QuitCommand(string option) {
48                 abort = false;
49                 
50                 //allow user to run help
51                 if(option == "help") { help(); abort = true; }
52
53 }
54 //**********************************************************************************************************************
55
56 void QuitCommand::help(){
57         try {
58                  m->mothurOut("The quit command will terminate mothur and should be in the following format: \n"); 
59                  m->mothurOut("quit() or quit\n\n");
60         }
61         catch(exception& e) {
62                 m->errorOut(e, "QuitCommand", "help");
63                 exit(1);
64         }
65 }
66
67 //**********************************************************************************************************************
68
69 QuitCommand::~QuitCommand(){}
70
71 //**********************************************************************************************************************
72
73 int QuitCommand::execute(){
74         if (abort == true) { return 0; }
75         return 1;
76 }
77
78 //**********************************************************************************************************************