class Shell {

	public Command readCommand(final LineReader lineReader, final String prompt) {
		String readLine;
		try {
			readLine = lineReader.readLine(prompt);
		} catch (final UserInterruptException e) {
			if (e.getPartialLine().isEmpty()) {
				// Exit request from user CTRL+C
				return ExitCommandInterpreter.EXIT_COMMAND;
			} else {
				return null; // used as empty command
			}
		} catch (final EndOfFileException e) {
			// Exit request from user CTRL+D
			return ExitCommandInterpreter.EXIT_COMMAND;
		}

		readLine = this.processReadLine(readLine);
		if (readLine.isEmpty()) {
			return null;
		}

		try {
			return this.interpreter.parseCommand(readLine);
		} catch (final ParsingException e) {
			this.interpreter.printNormal("Error: " + e.getMessage() + "\n" + e.getCause().getMessage() + "\n");
			return null;
		}
	}

	public  Shell(final Interpreter interpreter);

}