static void RunMessagesOption(Client client, Scanner scanner) 
			throws UnspecifiedErrorException, IOException, InvalidHeaderException {
		MessagesOptionShell.in = scanner;
		MessagesOptionShell.client = client;
		
		StringBuilder builder = new StringBuilder(String.format("\n%s > %s\n\n", SHELL_TITLE, Options.MESSAGES.getTitle()));
		
		builder.append("Please enter the number of the option to continue:\n");
		
		MessageOptions[] options = MessageOptions.values();
		
		// Prints each line in the main menu
		for (int i = 0; i < options.length; i++) {
			builder.append(String.format(MENU_ITEM_FORMAT_STRING, i + 1, options[i].getDescription()));
		}
		
		System.out.println(builder.toString());
		
		// Get the response
		boolean validInput;
		int result = -1;
		
		do {
			validInput = true;
						
			System.out.print("Selection: ");
			
			try {
				String input = in.nextLine();

				// Check if the input signifies a return to the main menu
				if (isReturnToMainMenu(input)) { 
					return;
				}
				
				result = Integer.parseInt(input);
				
				if (result < 1 || result > options.length) {
					throw new NumberFormatException("Input outside of range.");
				}	
			} catch (NumberFormatException ex) {
				System.out.println("Invalid entry, please re-enter your selection.");
				validInput = false;
			}			
		} while (!validInput);

		// Call the appropriate choice
		switch(options[result - 1]) {
		case SEND:
			SendMessageShell.sendMessageOption();
			break;
		case GET_QUEUES:
			getQueuesOption();
			break;
		case RETRIEVE:
			RetrieveMessageShell.retrieveMessageOption();
			break;
		}		
	}