diff --git a/mise-tasks/branch-cleanup b/mise-tasks/branch-cleanup index 9ddf618..57e9fca 100755 --- a/mise-tasks/branch-cleanup +++ b/mise-tasks/branch-cleanup @@ -5,6 +5,7 @@ # /// #MISE description="Delete branches that have been merged into main (local and remote)" #USAGE flag "--dry-run" help="Show what would be deleted without deleting" +#USAGE flag "--yes" help="Skip confirmation prompt" #USAGE flag "--local-only" help="Only clean up local branches" #USAGE flag "--remote-only" help="Only clean up remote branches" #USAGE flag "--cutoff " default="30" help="Only delete branches whose HEAD commit is older than N days (default 30)" @@ -115,6 +116,10 @@ def main( bool, typer.Option("--dry-run", help="Show what would be deleted without deleting"), ] = False, + yes: Annotated[ + bool, + typer.Option("--yes", "-y", help="Skip confirmation prompt"), + ] = False, local_only: Annotated[ bool, typer.Option("--local-only", help="Only clean up local branches"), @@ -211,7 +216,7 @@ def main( raise typer.Exit(0) # Confirm - if not typer.confirm("\nProceed with deletion?"): + if not yes and not typer.confirm("\nProceed with deletion?"): console.print("[dim]Aborted.[/dim]") raise typer.Exit(0)