public static void main(String[] args)
	{
		/*if (args.length < 3)
		{
			System.out.println("Not enough arguments. Arguments needed are contacts server ip, this client's port and your nickname (no spaces).");
			System.exit(-1);
		}
		else 
		{
			try
			{
				@SuppressWarnings("unused")
				Chat chat = new Chat(args[0], Integer.parseInt(args[1]), args[2]);
			}
			catch (NumberFormatException e)
			{
				System.out.println("Not enough arguments. Arguments needed are contacts server ip, this client's port and your nickname (no spaces).");
				System.exit(-1);
			}
		}*/
		
		BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
		String input, input_ip, input_name, input_port;

        System.out.println("Type your nickname (default nickname): ");
        try
        {
            input_name = console.readLine();
            if (input_name.equals(""))
                input_name = "nickname";
        } catch (IOException e) {
            input_name = "nickname";
        }


        System.out.println("Type server IP (default 127.0.0.1): ");
        try
        {
            input_ip = console.readLine();
            if (input_ip.equals(""))
                input_ip = "127.0.0.1";
        } catch (IOException e) {
            input_ip = "127.0.0.1";
        }

        System.out.println("Type your port (not 44000 - server uses it. default 44005): ");
        try
        {
            input_port = console.readLine();
            if (input_port.equals(""))
                input_port = "44005";
        } catch (IOException e) {
            input_port = "44005";
        }

        Chat chat = new Chat(input_ip, Integer.parseInt(input_port), input_name);

        System.out.println("Type /contacts to get a list of contacts.");
		System.out.println("Send messages by typing /w nickname before the message.");
		System.out.println("Type quit or exit to exit.");

		while(true)
		{
			try {
				input = console.readLine();
				parseUserInput(input);
			} catch (IOException e) {
                System.out.println("Invalid input.");
				System.exit(-1);
			}
		}
		
	}