cds icon indicating copy to clipboard operation
cds copied to clipboard

run-delete --no-interactive still ask for confirmation

Open nicoovh opened this issue 2 years ago • 1 comments

When I launch:

cdsctl workflow run-delete -n PROJECT my-workflow-name 315
# or 
cdsctl workflow run-delete --no-interactive PROJECT my-workflow-name 315

it asks for confirmation

? Are you sure to delete? (Y/n)

Version:

❯ cdsctl version
cdsctl:
  version: 0.52.0
  architecture: arm64
  os: darwin
  git_hash: 1da97b5e45e1630f2da5b07c3e1789dd6d939e8d
  build_time: 09/26/22-14:58:49
  keychain: false
api:
  version: 0.52.0-42-g20c5156.18205
  architecture: amd64
  os: linux
  git_hash: 20c51569bd1ffeae6f672a8941874cf4ee3a2e0c
  build_time: 11/08/22-10:10:46
  db_migrate: "0"

nicoovh avatar Nov 09 '22 10:11 nicoovh

In the help/documentation, the option to be non interactive is --no-interactive In the code, the option is --force

		case RunDeleteFunc:
			if f == nil {
				cmd.Help() // nolint
				OSExit(0)
			}

			force, _ := cmd.Flags().GetBool("force")

			if !force && !AskConfirm("Are you sure to delete?") {
				fmt.Println("Deletion aborted")
				OSExit(0)
			}

nicoovh avatar Nov 09 '22 10:11 nicoovh