@Override
    @SuppressWarnings({"unchecked", "rawtypes"})
    public @NonNull CompletableFuture<Iterable<@NonNull Suggestion>> suggestionsFuture(
            final @NonNull CommandContext<C> commandContext,
            final @NonNull CommandInput input
    ) {
        /* Check if we have a last flag stored */
        final String lastArg = Objects.requireNonNull(commandContext.getOrDefault(FLAG_META_KEY, ""));
        if (!lastArg.startsWith("-")) {
            final String readInput = input.readInput();
            /* Collection containing all used flags */
            final List<CommandFlag<?>> usedFlags = new LinkedList<>();
            /* Find all "primary" flags, using --flag */
            final Matcher primaryMatcher = FLAG_PRIMARY_PATTERN.matcher(readInput);
            while (primaryMatcher.find()) {
                final String name = primaryMatcher.group("name");
                for (final CommandFlag<?> flag : this.flags) {
                    if (flag.name().equalsIgnoreCase(name)) {
                        usedFlags.add(flag);
                        break;
                    }
                }
            }
            /* Find all alias flags */
            final Matcher aliasMatcher = FLAG_ALIAS_PATTERN.matcher(readInput);
            while (aliasMatcher.find()) {
                final String name = aliasMatcher.group("name");
                for (final CommandFlag<?> flag : this.flags) {
                    for (final String alias : flag.aliases()) {
                        /* Aliases are single-char strings */
                        if (name.contains(alias)) {
                            usedFlags.add(flag);
                            break;
                        }
                    }
                }
            }
            final String nextToken = input.peekString();
            final String currentFlag;
            if (nextToken.length() > 1) {
                currentFlag = nextToken.substring(1);
            } else {
                currentFlag = "";
            }
            /* Suggestions */
            final List<Suggestion> suggestions = new LinkedList<>();
            /* Recommend "primary" flags */
            for (final CommandFlag<?> flag : this.flags) {
                if (usedFlags.contains(flag) && flag.mode() != CommandFlag.FlagMode.REPEATABLE) {
                    continue;
                }
                if (!commandContext.hasPermission(flag.permission())) {
                    continue;
                }

                suggestions.add(Suggestion.suggestion(String.format("--%s", flag.name())));
            }
            /* Recommend aliases */
            final boolean suggestCombined = nextToken.length() > 1 && nextToken.startsWith("-") && !nextToken.startsWith("--");
            for (final CommandFlag<?> flag : this.flags) {
                if (usedFlags.contains(flag) && flag.mode() != CommandFlag.FlagMode.REPEATABLE) {
                    continue;
                }
                if (!commandContext.hasPermission(flag.permission())) {
                    continue;
                }

                for (final String alias : flag.aliases()) {
                    if (alias.equalsIgnoreCase(currentFlag)) {
                        continue;
                    }
                    if (suggestCombined && flag.commandComponent() == null) {
                        suggestions.add(Suggestion.suggestion(String.format("%s%s", input.peekString(), alias)));
                    } else {
                        suggestions.add(Suggestion.suggestion(String.format("-%s", alias)));
                    }
                }
            }
            /* If we are suggesting the combined flag, then also suggest the current input */
            if (suggestCombined) {
                suggestions.add(Suggestion.suggestion(input.peekString()));
            }
            return CompletableFuture.completedFuture(suggestions);
        } else {
            CommandFlag<?> currentFlag = null;
            if (lastArg.startsWith("--")) { // --long
                final String flagName = lastArg.substring(2);
                for (final CommandFlag<?> flag : this.flags) {
                    if (flagName.equalsIgnoreCase(flag.name())) {
                        currentFlag = flag;
                        break;
                    }
                }
            } else { // -x
                final String flagName = lastArg.substring(1);
                outer:
                for (final CommandFlag<?> flag : this.flags) {
                    for (final String alias : flag.aliases()) {
                        if (alias.equalsIgnoreCase(flagName)) {
                            currentFlag = flag;
                            break outer;
                        }
                    }
                }
            }
            if (currentFlag != null
                    && commandContext.hasPermission(currentFlag.permission())
                    && currentFlag.commandComponent() != null) {
                final SuggestionProvider suggestionProvider = currentFlag.commandComponent().suggestionProvider();
                return suggestionProvider.suggestionsFuture(commandContext, input);
            }
        }
        commandContext.store(FLAG_META_KEY, "");
        return this.suggestionsFuture(commandContext, input);
    }
Parses command input to figure out what flag is currently being
typed at the end of the input queue. If no flag value is being
inputted, returns {@link Optional#empty()}.<br>
<br>
Will consume all but the last element from the input queue.

@param commandContext Command context
@param commandInput   The input arguments
@param completionExecutor The completion executor
@return current flag being typed, or {@code empty()} if none is
cloud-core/src/main/java/org/incendo/cloud/parser/flag/CommandFlagParser.java