package edu.kit.mindstorms.communication;

import java.io.IOException;
import java.util.Scanner;

public class Shell {

	private static ComModule com;

	public static void main(String[] args) {
		com = Communication.getModule();

		try (Scanner scanner = new Scanner(System.in)) {
			boolean quit = false;
			while (!quit) {
				System.out.print("> ");
				if (scanner.hasNext()) {
					String input = scanner.nextLine();
					quit = evaluate(input);
//					break;
				}
			}
		} catch (Exception e) {
			System.err.println(e.getMessage());
		}
	}

	private static boolean evaluate(String input) throws IOException {
		boolean quit = false;

		long start = System.nanoTime();
		boolean response = false;
		switch (input.toUpperCase()) {
		case "UP":
			System.out.println("Starting request...");
			response = com.requestElevator();
			System.out.println("Called elevator");
			System.out.println("Response: " + response);
			break;
		case "DOWN":
			System.out.println("Starting request...");
			response = com.moveElevatorDown();
			System.out.println("Requested elevator to move down");
			System.out.println("Response: " + response);
			break;
		case "STATUS":
			System.out.println("Starting request...");
			response = com.requestStatus();
			System.out.println("Requested elevator status");
			System.out.println("Response: " + response);
			break;
		case "Q":
		case "QUIT":
		case "EXIT":
			System.out.println("Quitting...");
			quit = true;
			break;
		default:
			System.out.println("Unknown command: " + input);
		}

		long end = System.nanoTime() - start;
		System.out.println("Time (ms): " + Double.valueOf(end) / 1000000);
		
		return quit;
	}

}

@@ -384,23 +384,24 @@
 %09%09%09%09
-String input = 
+quit = evaluate(
 scan
@@ -418,51 +418,9 @@
 ne()
-;%0A%09%09%09%09%09quit = evaluate(input);%0A//%09%09%09%09%09break
+)
 ;%0A%09%09

Fix comment