@Override
	public void run() {
		String line;
		Scanner in = new Scanner(System.in);
		while (true) {
			System.out.print("> ");
			line = in.nextLine().trim().toLowerCase();
			Iterator<String> tokens = Arrays.asList(line.split("\\s+")).iterator();
			String command = tokens.next();
			if (command.startsWith("exit")) {
				break;
			} else if (command.startsWith("add")) {
				processAdd(tokens);
			} else if (command.startsWith("ip")) {
				processIp(tokens);
			} else if (command.startsWith("path")) {
				processPath(tokens);
			} else if (command.startsWith("status")) {
				processStatus(tokens);
			} else if (command.startsWith("tasks")) {
				processTasks(tokens);
			} else if (command.startsWith("results")) {
				processResults(tokens);
			} else if (command.startsWith("help")) {
				System.out.println("Command list:");
				System.out.println("  add path [SECTION_SIZE]");
				System.out.println("  ip [NEW_IP]");
				System.out.println("  path [NEW_PATH]");
				System.out.println("  results [OUTPUT_FILE_PATH]");
				System.out.println("  status");
				System.out.println("  tasks [nostatus]");
			} else {
				System.out.println("Invalid command, type help to display all available commands.");
			}
		}
		in.close();
		System.out.println("Bye.");
	}