public void Run() { while (true) { writer.WriteLine("Enter a command."); var line = reader.ReadLine(); var splitLine = line.Split(' '); try { var commandName = splitLine[0]; var command = interpreter.Intepret(commandName); var commandArguments = splitLine.Skip(1).ToArray(); var result = command.Execute(commandArguments); writer.WriteLine(result); } catch (InvalidOperationException e) { writer.WriteLine(e.Message); } } }