From 8d1b830ff1a6d4be8f0ffd160600ab5d4d66ac0b Mon Sep 17 00:00:00 2001 From: Orkhan Ahmadov Date: Wed, 17 Jan 2024 10:17:03 +0100 Subject: [PATCH 1/2] 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.'); } From 930b59d2ac8273a5d7a1a84e3337306bdba5e0d1 Mon Sep 17 00:00:00 2001 From: Orkhan Ahmadov Date: Wed, 17 Jan 2024 10:22:02 +0100 Subject: [PATCH 2/2] fixes --- src/Commands/RecordDeleteCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Commands/RecordDeleteCommand.php b/src/Commands/RecordDeleteCommand.php index 7d8e651d..8871eea5 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 { @@ -32,7 +33,7 @@ protected function configure() public function handle() { $forceDeletion = $this->option('force', false); - + if (! $forceDeletion && ! Helpers::confirm('Are you sure you want to delete this record', false)) { Helpers::abort('Action cancelled.'); }