Files
warewulf/internal/pkg/util/confirm.go
Jonathon Anderson 73a8ef8e0e Refactor wwctl <node|profile> edit and fix bugs
`wwctl node edit` appears to not be working properly since MergeNode. This
refactor, partly towards #918, resolves the issues with `node edit` and updates
`profile edit` to match.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-19 13:02:18 -07:00

22 lines
368 B
Go

package util
import (
"github.com/manifoldco/promptui"
)
// ConfirmationPrompt prompt is a blocking confirmation prompt.
// Returns true on y or yes user input.
func Confirm(label string) (yes bool) {
prompt := promptui.Prompt{
Label: label,
IsConfirm: true,
}
result, _ := prompt.Run()
if result == "y" || result == "yes" {
yes = true
}
return
}