From 85b3d92fbf481d74b91ddb3a8e6651331eaec57f Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Sun, 22 Feb 2026 15:29:00 -0800 Subject: [PATCH] Add --yes flag to skip interactive confirmation Needed for non-TTY contexts where the prompt defaults to N. Co-Authored-By: Claude Opus 4.6 --- mise-tasks/branch-cleanup | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)