Skip to content

cmd

Commands for cleaning up PRs.

close_prs(keep_remote_branches=typer.Option(False, is_flag=True, help='Does not delete remote branches'))

Closes all pull requests.

Source code in dapla_team_cli/pr/janitor/cmd.py
13
14
15
16
17
18
19
20
21
22
@app.command("close-prs")
def close_prs(
    keep_remote_branches: bool = typer.Option(False, is_flag=True, help="Does not delete remote branches")
) -> None:  # noqa: B008
    # Optional argument for deleting branches as well
    """Closes all pull requests."""
    if state := state_object_handler.get_user_state():
        close_all(state, keep_remote_branches)
    else:
        sys.exit(1)