setDescription('Unmount databox') ->addArgument('databox_id', InputArgument::REQUIRED, 'The id of the databox to unmount', null) ; return $this; } protected function doExecute(InputInterface $input, OutputInterface $output) { try { $databox = $this->container->findDataboxById($input->getArgument('databox_id')); $dialog = $this->getHelperSet()->get('dialog'); do { $continue = mb_strtolower($dialog->ask($output, ' Do you want really unmount this databox? (y/N)', 'N')); } while ( ! in_array($continue, ['y', 'n'])); if ($continue !== 'y') { $output->writeln('Aborting !'); return; } $databox->unmount_databox(); $output->writeln('Unmount databox successful'); } catch (\Exception $e) { $output->writeln('Unmount databox failed : '.$e->getMessage().''); } return 0; } }