private int flagStartIndex(final @NonNull List<CommandComponent<C>> components) {
        // Append flags after the last static argument
        if (this.commandManager.settings().get(ManagerSetting.LIBERAL_FLAG_PARSING)) {
            for (int i = components.size() - 1; i >= 0; i--) {
                if (components.get(i).type() == CommandComponent.ComponentType.LITERAL) {
                    return i;
                }
            }
        }

        // Append flags after the last argument
        return components.size() - 1;
    }
Returns the index of the given {@code components} list after which flags may be inserted.

@param components the components
@return the index after which flags may be inserted
cloud-core/src/main/java/org/incendo/cloud/CommandTree.java