[pbs-devel] [PATCH proxmox v5 1/2] router: cli: added `ask_for_confirmation` helper

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Apr 25 13:32:33 CEST 2024


Am 25/04/2024 um 12:37 schrieb Gabriel Goller:
> anyhow is already used in proxmox-router so I'd say we can just as well
> use it. A simple bail! with the message you proposed should do the trick:
> 
>     Abort – unexpected choice "no"! Use enter for default or use 'y' or 'n'.


I'd drop the "Abort -" here and bail only with the "unexpected choice "{input}"!
Use enter for default or use 'y' or 'n'" here, as what the calling code then
does is their decision, might not necessarily be aborting the current operation,
but re-asking the user again.




More information about the pbs-devel mailing list