From 8d1b830ff1a6d4be8f0ffd160600ab5d4d66ac0b Mon Sep 17 00:00:00 2001 From: Orkhan Ahmadov Date: Wed, 17 Jan 2024 10:17:03 +0100 Subject: [PATCH] Update RecordDeleteCommand.php --- src/Commands/RecordDeleteCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Commands/RecordDeleteCommand.php b/src/Commands/RecordDeleteCommand.php index 477e5f91..7d8e651d 100644 --- a/src/Commands/RecordDeleteCommand.php +++ b/src/Commands/RecordDeleteCommand.php @@ -20,6 +20,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 +31,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.'); }