5 * Created by Thomas Ryabin on 1/30/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "getlinecommand.h"
12 //**********************************************************************************************************************
13 GetlineCommand::GetlineCommand(string option){
15 globaldata = GlobalData::getInstance();
18 //allow user to run help
19 if(option == "help") { help(); abort = true; }
22 if (option != "") { mothurOut("There are no valid parameters for the get.line command."); mothurOutEndLine(); abort = true; }
24 if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { mothurOut("You must read a list, sabund or rabund before you can use the get.line command."); mothurOutEndLine(); abort = true; }
29 errorOut(e, "GetlineCommand", "GetlineCommand");
33 //**********************************************************************************************************************
35 void GetlineCommand::help(){
37 mothurOut("The get.line command can only be executed after a successful read.otu command.\n");
38 mothurOut("You may not use any parameters with the get.line command.\n");
39 mothurOut("The get.line command should be in the following format: \n");
40 mothurOut("get.line()\n");
41 mothurOut("Example get.line().\n");
44 errorOut(e, "GetlineCommand", "help");
49 //**********************************************************************************************************************
51 GetlineCommand::~GetlineCommand(){
54 //**********************************************************************************************************************
56 int GetlineCommand::execute(){
59 if (abort == true) { return 0; }
62 openInputFile(globaldata->inputFileName, in);
71 mothurOut(toString(line)); mothurOutEndLine();
84 errorOut(e, "GetlineCommand", "execute");