]> git.donarmstrong.com Git - mothur.git/blobdiff - getcurrentcommand.cpp
fixes while testing 1.33.0
[mothur.git] / getcurrentcommand.cpp
index 7bfae208ad9eb6b1a94ba92e2ae028c2f986f24a..b9b907d903752d8a93979680d361c2ea683c7cab 100644 (file)
@@ -12,9 +12,9 @@
 //**********************************************************************************************************************
 vector<string> GetCurrentCommand::setParameters(){     
        try {
-               CommandParameter pclear("clear", "String", "", "", "", "", "",false,false); parameters.push_back(pclear);
-               CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
-               CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
+               CommandParameter pclear("clear", "String", "", "", "", "", "","",false,false); parameters.push_back(pclear);
+               CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir);
+               CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir);
                
                vector<string> myArray;
                for (int i = 0; i < parameters.size(); i++) {   myArray.push_back(parameters[i].name);          }
@@ -59,6 +59,7 @@ GetCurrentCommand::GetCurrentCommand(string option)  {
                
                //allow user to run help
                if(option == "help") { help(); abort = true; calledHelp = true; }
+               else if(option == "citation") { citation(); abort = true; calledHelp = true;}
                
                else {
                        vector<string> myArray = setParameters();
@@ -89,7 +90,9 @@ int GetCurrentCommand::execute(){
        try {
                
                if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
-               
+        
+               cFactory = CommandFactory::getInstance();
+        
                //user wants to clear a type
                if (types.size() != 0) {
                        for (int i = 0; i < types.size(); i++) {
@@ -134,7 +137,17 @@ int GetCurrentCommand::execute(){
                                }else if (types[i] == "accnos") {
                                        m->setAccnosFile("");
                                }else if (types[i] == "taxonomy") {
-                                               m->setTaxonomyFile("");
+                                       m->setTaxonomyFile("");
+                               }else if (types[i] == "flow") {
+                                       m->setFlowFile("");
+                }else if (types[i] == "biom") {
+                                       m->setBiomFile("");
+                }else if (types[i] == "count") {
+                                       m->setCountTableFile("");
+                }else if (types[i] == "summary") {
+                                       m->setSummaryFile("");
+                               }else if (types[i] == "processors") {
+                                       m->setProcessors("1");
                                }else if (types[i] == "all") {
                                        m->clearCurrentFiles();
                                }else {
@@ -143,10 +156,35 @@ int GetCurrentCommand::execute(){
                        }
                }
                
-               m->mothurOutEndLine(); m->mothurOut("Current files saved by mothur:"); m->mothurOutEndLine();
-               m->printCurrentFiles();
+               if (m->hasCurrentFiles()) {
+                       m->mothurOutEndLine(); m->mothurOut("Current files saved by mothur:"); m->mothurOutEndLine();
+                       m->printCurrentFiles();
+               }
+        
+        string inputDir = cFactory->getInputDir();
+        if (inputDir != "") {
+            m->mothurOutEndLine(); m->mothurOut("Current input directory saved by mothur: " + inputDir); m->mothurOutEndLine();
+        }
+        
+        string outputDir = cFactory->getOutputDir();
+        if (outputDir != "") {
+            m->mothurOutEndLine(); m->mothurOut("Current output directory saved by mothur: " + outputDir); m->mothurOutEndLine();
+        }
+        string defaultPath = m->getDefaultPath();
+        if (defaultPath != "") {
+            m->mothurOutEndLine(); m->mothurOut("Current default directory saved by mothur: " + defaultPath); m->mothurOutEndLine();
+        }
+        
+        
+        string temp = "./";
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
+#else
+            temp = ".\\";
+#endif
+        temp = m->getFullPathName(temp);
+        m->mothurOutEndLine(); m->mothurOut("Current working directory: " + temp); m->mothurOutEndLine();
                
-               return 0;       
+               return 0;
        }
        
        catch(exception& e) {