aboutsummaryrefslogtreecommitdiff
path: root/src/esieequest/controller/Parser.java
blob: 117d69f9d7c328bd9ee72e32131c64432328ffbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package esieequest.controller;

import esieequest.model.command.Command;

public class Parser {

	public Parser() {
	}

	public Command getCommand(String commandString) {
		String[] elements = commandString.split(" ");

		String action = null;
		String option = null;

		if (elements.length > 0) {
			action = elements[0];
		}
		if (elements.length > 1) {
			option = elements[1];
		}

		return new Command(action, option);
	}

	private void validateCommand() {
		// TODO
	}

}