private void findAnnotations(Class clazz) {

        if (clazz.getSuperclass() != null) {
            findAnnotations(clazz.getSuperclass());
        }

        for (Method m : clazz.getDeclaredMethods()) {
            Command c = null;
            m.setAccessible(true);

            if ((c = m.getAnnotation(Command.class)) != null) {

                String commandName = c.name();
                if (commandName.equals(Command.METHOD_NAME)) {
                    commandName = m.getName();
                }

                Annotation[][] annArray = m.getParameterAnnotations();

                int requiredArguments = 0;

                for (int i = 0; i < annArray.length; i++) {
                    requiredArguments++;
                    for (int j = 0; j < annArray[i].length; j++) {
                        if (annArray[i][j] instanceof Argument) {
                            Argument argument = (Argument) annArray[i][j];
                            if (argument.optional()) {
                                requiredArguments--;
                            }
                            break;
                        }
                    }
                }


                if (c.help().equals(Command.NO_HELP)) {
                    this.commands.put(commandName.trim().toLowerCase(), new ShellCommand(commandName, m, requiredArguments));
                } else {
                    this.commands.put(commandName.trim().toLowerCase(), new ShellCommand(commandName, m, requiredArguments, c.help()));
                }
            }

        }
    }