Create function for asking yes or no questions
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
12
cli.go
12
cli.go
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user