- errorFree = errorCheckor->checkInput(input);
- if (errorFree == true) {
- CommandOptionParser parser(input);
- commandName = parser.getCommandString();
- ifstream filehandle;
-
- if (openedBatch == 0) { //able to open batchfile
- //executes valid command
- CommandFactory cFactory;
- Command* command = cFactory.getCommand(commandName);
- quitCommandCalled = command->execute();
- }
- else {
- cout << "Invalid." << endl;
- }
- }
- else {
- cout << "Unable to open batchfile." << endl;
- }
- }else { if (inputBatchFile.eof()) { input = "quit()"; } }
+ CommandOptionParser parser(input);
+ commandName = parser.getCommandString();
+ options = parser.getOptionString();
+
+ if (commandName != "") {
+
+ //executes valid command
+ CommandFactory cFactory;
+ Command* command = cFactory.getCommand(commandName, options);
+ quitCommandCalled = command->execute();
+ }else { cout << "Invalid." << endl; }
+
+ }