def show_modules(config, modules_list):
    """
    List modules available optionally with details.
    """
    details = config["full"]
    core_mods = not config["user"]
    user_mods = not config["core"]

    modules = core_module_docstrings(include_core=core_mods, include_user=user_mods, config=config)

    new_modules = []
    if modules_list:
        from fnmatch import fnmatch

        for _filter in modules_list:
            for name in modules:
                if fnmatch(name, _filter):
                    if name not in new_modules:
                        new_modules.append(name)
    else:
        new_modules = list(modules)

    for name in sorted(new_modules):
        module = _to_docstring(modules[name])
        desc = module[0][:-1]
        if details:
            dash_len = len(name) + 4
            print("#" * dash_len)
            print(f"# {name} #")
            print("#" * dash_len)
            for description in module:
                print(description[:-1])
        else:
            print(f"{name:<22} {desc}")

    List modules available optionally with details.
    
py3status/docstrings.py