def fn_alias(alias: str, opts) -> str:
    """Return aliased name."""
    fmt_alias = '[active]{0}[dim]{1}'
    fmt_no_alias = '[active]{0}[dim]({1})'
    if alias not in opts.alias:
        return fmt_no_alias.format(alias, opts.alias)
    return fmt_alias.format(alias, opts.alias.replace(alias, ''))