`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>
22 lines
368 B
Go
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
|
|
}
|