fix: handle NoInput for volume removal

This commit is contained in:
decentral1se 2022-03-12 16:09:05 +01:00
parent 6e1e02ac28
commit a8f35bdf2f
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 4 additions and 2 deletions

View File

@ -85,7 +85,7 @@ Passing "--force/-f" will select all volumes for removal. Be careful.
volumeNames := client.GetVolumeNames(volumeList)
var volumesToRemove []string
if !internal.Force {
if !internal.Force && !internal.NoInput {
volumesPrompt := &survey.MultiSelect{
Message: "which volumes do you want to remove?",
Help: "'x' indicates selected, enter / return to confirm, ctrl-c to exit, vim mode is enabled",
@ -96,7 +96,9 @@ Passing "--force/-f" will select all volumes for removal. Be careful.
if err := survey.AskOne(volumesPrompt, &volumesToRemove); err != nil {
logrus.Fatal(err)
}
} else {
}
if internal.Force || internal.NoInput {
volumesToRemove = volumeNames
}