5 * Created by Sarah Westcott on 7/8/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "systemcommand.h"
12 //**********************************************************************************************************************
14 SystemCommand::SystemCommand(string option){
18 //allow user to run help
19 if(option == "help") { help(); abort = true; }
22 if (option == "") { mothurOut("You must enter a command to run."); mothurOutEndLine(); abort = true; }
23 else { command = option; }
28 errorOut(e, "SystemCommand", "SystemCommand");
32 //**********************************************************************************************************************
34 void SystemCommand::help(){
36 mothurOut("The system command allows you to execute a system command from within mothur.\n");
37 mothurOut("The system has no parameters.\n");
38 mothurOut("The system command should be in the following format: system(yourCommand).\n");
39 mothurOut("Example system(clear).\n");
42 errorOut(e, "SystemCommand", "help");
47 //**********************************************************************************************************************
49 int SystemCommand::execute(){
52 if (abort == true) { return 0; }
54 system(command.c_str());
60 errorOut(e, "SystemCommand", "execute");
65 //**********************************************************************************************************************