Create function for asking yes or no questions
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2022-11-30 21:58:21 -08:00
parent eaf49a4594
commit 4e71a5c35c
2 changed files with 18 additions and 12 deletions

12
cli.go
View File

@@ -29,3 +29,15 @@ func pkgPrompt(options []db.Package, verb string) ([]db.Package, error) {
return out, nil
}
func yesNoPrompt(msg string, def bool) (bool, error) {
var answer bool
err := survey.AskOne(
&survey.Confirm{
Message: msg,
Default: def,
},
&answer,
)
return answer, err
}