cli/password: allow forced reset (#27293)

This commit is contained in:
andig 2026-02-08 11:28:13 +01:00 • committed by GitHub
parent 9a9527d224
commit 73bf912422
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,7 @@ var passwordResetCmd = &cobra.Command{
func init() {
passwordCmd.AddCommand(passwordResetCmd)
passwordResetCmd.Flags().BoolP(flagForce, "f", false, "Force (no confirmation)")
}
func runPasswordReset(cmd *cobra.Command, args []string) {
@ -28,14 +29,17 @@ func runPasswordReset(cmd *cobra.Command, args []string) {
log.FATAL.Fatal(err)
}
prompt := &survey.Confirm{
Message: "Are you sure?",
Help: "help",
}
confirm, _ := cmd.Flags().GetBool(flagForce)
var confirm bool
if err := survey.AskOne(prompt, &confirm); err != nil {
log.FATAL.Fatal(err)
if !confirm {
prompt := &survey.Confirm{
Message: "Are you sure?",
Help: "help",
}
if err := survey.AskOne(prompt, &confirm); err != nil {
log.FATAL.Fatal(err)
}
}
if confirm {