private static void exec(String[] args, HelloApp app) {
		try {
			if ("greet".equals(args[0]))
				app.greet();
			else if ("list".equals(args[0])) {
				if (args.length > 1)
					app.listPepleInCity(args[1]);
				else
					app.listPeple();
			}
			else if ("show".equals(args[0]))
				app.showPersonByNameAndSurname(args[1], args[2]);
			else if ("add".equals(args[0])) {
				Map<String,Object> attributesAsMap = new HashMap<>();
				attributesAsMap.put("the name", args[1]);
				attributesAsMap.put("the surname", args[2]);
				attributesAsMap.put("the age as biginteger", BigInteger.valueOf(42));
				app.addPerson(new Person(args[1], args[2], args[3], Integer.parseInt(args[4]),
						attributesAsMap));
			} else if ("quit".equals(args[0])) {
				logger.info("bye.");
				System.exit(0);
			}
			else if ("help".equals(args[0])) {
				logger.info(SYNTAX);
			}
			else {
				logger.error("Invalid command: '" + dumpCommands(args) + '\'');
				logger.info(SYNTAX);
			}
		}
        catch (ArrayIndexOutOfBoundsException e) {
			logger.error("Bad syntax.\n" + SYNTAX);
		}
        catch (NumberFormatException e) {
        	logger.error("Invalid integer", e);
        }
	}