From 345968271dec38b33a32649d8cfb767c2806330d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 24 Jun 2026 09:57:33 +0200 Subject: feat: global -y/--yes flag to skip additive confirmations repo create's y/N push confirmation can now be skipped with -y. The flag is global (top-level parser), so it goes before the subcommand: gitctl -y repo create ... . The diff is still printed and an auto-confirmed note shown. -y does NOT bypass SSH key auth (the phase-1 push still needs the password / smartcard touch), so creation is never fully unattended. Hard wall: -y is never honored by a future destructive delete; the flag help, a client comment, and TODO item 1 all record this. Bash completion offers -y at the top level and transparently skips a leading -y when resolving the subcommand. Self-test pins the parse round-trip. Client-only change; the server helper is unchanged, no redeploy needed. Co-Authored-By: Claude Opus 4.8 --- completions/gitctl.bash | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'completions') diff --git a/completions/gitctl.bash b/completions/gitctl.bash index 6fead65..3d072fe 100644 --- a/completions/gitctl.bash +++ b/completions/gitctl.bash @@ -12,7 +12,12 @@ _gitctl() { cword=$COMP_CWORD } - local group=${words[1]} action=${words[2]} + # global -y/--yes may sit before the subcommand; skip it so group/action and + # the cword positions below line up whether or not it is present. + local off=0 + [[ ${words[1]} == "-y" || ${words[1]} == "--yes" ]] && off=1 + local group=${words[1+off]} action=${words[2+off]} + local cword=$((cword - off)) # complete section names from the live server (one ssh call). Only when the # previous word is --section, so we do not pay it on every Tab. @@ -26,7 +31,7 @@ _gitctl() { case $cword in 1) - COMPREPLY=($(compgen -W "sections sync repo" -- "$cur")) + COMPREPLY=($(compgen -W "-y --yes sections sync repo" -- "$cur")) return ;; 2) case $group in -- cgit v1.2.3