setName('groupfolders:delete') ->setDescription('Delete Team folder') ->addArgument('folder_id', InputArgument::REQUIRED, 'Id of the folder to rename') ->addOption('force', 'f', InputOption::VALUE_NONE, 'Skip confirmation'); parent::configure(); } protected function execute(InputInterface $input, OutputInterface $output): int { $folder = $this->getFolder($input, $output); if ($folder === null) { return -1; } $helper = $this->getHelper('question'); $question = new ConfirmationQuestion('Are you sure you want to delete the Team folder ' . $folder->mountPoint . ' and all files within, this cannot be undone (y/N).', false); if ($input->getOption('force') || $helper->ask($input, $output, $question)) { $this->folderStorageManager->deleteStoragesForFolder($folder); $this->folderManager->removeFolder($folder->id); } return 0; } }