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 <noreply@anthropic.com>
This commit is contained in:
parent
e3685f5ca7
commit
85b3d92fbf
1 changed files with 6 additions and 1 deletions
|
|
@ -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 <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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue