#include "getlabelcommand.h"
+//**********************************************************************************************************************
+vector<string> GetlabelCommand::getValidParameters(){
+ try {
+ string Array[] = {"outputdir","inputdir"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "GetlabelCommand", "getValidParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> GetlabelCommand::getRequiredParameters(){
+ try {
+ vector<string> myArray;
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "GetlabelCommand", "getRequiredParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> GetlabelCommand::getRequiredFiles(){
+ try {
+ string Array[] = {"list","rabund","sabund", "or"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "GetlabelCommand", "getRequiredFiles");
+ exit(1);
+ }
+}
//**********************************************************************************************************************
GetlabelCommand::GetlabelCommand(string option) {
try {
globaldata = GlobalData::getInstance();
- abort = false;
+ abort = false; calledHelp = false;
//allow user to run help
- if(option == "help") { help(); abort = true; }
+ if(option == "help") { help(); abort = true; calledHelp = true; }
else {
if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { m->mothurOut("You must read a list, sabund or rabund before you can use the get.label command."); m->mothurOutEndLine(); abort = true; }
int GetlabelCommand::execute(){
try {
- if (abort == true) { return 0; }
+ if (abort == true) { if (calledHelp) { return 0; } return 2; }
filename = globaldata->inputFileName;
ifstream in;