Skip to content

harbor_cli.output.formatting.path

Control the formatting of console output.

Functions

Return a link to a path.

Source code in harbor_cli/output/formatting/path.py
def path_link(path: Path, absolute: bool = True) -> str:
    """Return a link to a path."""
    abspath = path.resolve().absolute()
    if absolute:
        path_str = str(abspath)
    else:
        path_str = str(path)
    return f"[link=file://{abspath}]{path_str}[/link]"