diff --git a/src/Commands/RecordDeleteCommand.php b/src/Commands/RecordDeleteCommand.php index 477e5f9..8871eea 100644 --- a/src/Commands/RecordDeleteCommand.php +++ b/src/Commands/RecordDeleteCommand.php @@ -4,6 +4,7 @@ use Laravel\VaporCli\Helpers; use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; class RecordDeleteCommand extends Command { @@ -20,6 +21,7 @@ protected function configure() ->addArgument('type', InputArgument::REQUIRED, 'The record type') ->addArgument('name', InputArgument::OPTIONAL, 'The record name') ->addArgument('value', InputArgument::OPTIONAL, 'The record value') + ->addOption('force', false, InputOption::VALUE_NONE, 'Force deletion of the record without confirmation') ->setDescription('Delete a DNS record'); } @@ -30,7 +32,9 @@ protected function configure() */ public function handle() { - if (! Helpers::confirm('Are you sure you want to delete this record', false)) { + $forceDeletion = $this->option('force', false); + + if (! $forceDeletion && ! Helpers::confirm('Are you sure you want to delete this record', false)) { Helpers::abort('Action cancelled.'); }