def _format_host_port_alias(host, port, alias):
    """Format a host, port, and alias so it can be used for comparison or display."""
    if alias:
        return f"{alias}@{host}:{port}"
    return f"{host}:{port}"