public Command parse(String[] args) throws ParseException {
		
		// if no args are given, do defaultAction
		if (args.length == 0) {
			args = new String[] {defaultAction.toString()};
		}

		// determine action and get syntax for it
		CommandSyntax syntax = parseAction(args);
		Command.ActionType action = syntax.getAction();

		// Make List from Array without action-name
		List<String> argList = Arrays.asList(Arrays.copyOfRange(args, 1, args.length));

		// Datastructures to hand over to Command-Object
		ArrayList<String> flags = new ArrayList<String>();
		HashMap<String, String> options = new HashMap<String, String>();
		ArrayList<String> parameters = new ArrayList<String>();

		// Number of arguments that are passed
		int numParams = 0;

		// Iterate over args List
		Iterator<String> iterator = argList.iterator();
		while (iterator.hasNext()) {
			String currentArg = iterator.next();

			// If arg starts with "-" it is a flag or an option
			if (currentArg.startsWith("-")) {

				String optName = currentArg.substring(1);

				// Add Option
				if (syntax.allowsOption(optName)) {
					if (!iterator.hasNext()) {
						throw new ParseException("Option \"" + optName + "\"" +
								" needs a parameter");
					}
					this.insertOptionToMap(optName, iterator.next(), options);

				// Add Flag
				} else if (syntax.allowsFlag(optName)) {
					flags.add(optName);

				// option/flag not allowed => throw Exception
				} else {
					throw new ParseException("Action \"" + action
							+ "\" doesn't allow option \"" + currentArg + "\"");
				}

			// String doesn't start with "-" => normal argument
			} else {
				numParams++;
				parameters.add(currentArg);
			}
		}

		// If given arguments doesn't match syntax, throw error
		if (numParams != syntax.getNumParams()) {
			throw new ParseException("Action \"" + action + "\" "
					+ "takes " + syntax.getNumParams() + " argument(s)");
		}

		// Make variables that can be passed to the Command-Constructor
		String[] parametersArray = parameters.toArray(new String[0]);
		String[] flagsArray = flags.toArray(new String[0]);
		
		return new Command(action, parametersArray, options, flagsArray);
		
	}