private static String getCommandName(String commandAsStr) {
        int whiteSpaceIndex = commandAsStr.indexOf(" ");
        if (whiteSpaceIndex == -1) {
            return commandAsStr;
        }

        String commandName = commandAsStr.substring(0, whiteSpaceIndex);
        return commandName.trim();
    }