From 7bc4cdaafb4dbee0f1d3367b934850c6e44ba9eb Mon Sep 17 00:00:00 2001 From: Guillaume Date: Sun, 27 Jan 2019 15:41:57 +0100 Subject: [PATCH] [CLI] Add --force option (implement #289). --- app/Console/Command/Task/SyncTask.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Console/Command/Task/SyncTask.php b/app/Console/Command/Task/SyncTask.php index 3a813ec..9b0e810 100644 --- a/app/Console/Command/Task/SyncTask.php +++ b/app/Console/Command/Task/SyncTask.php @@ -390,7 +390,7 @@ public function clean() */ private function isAgree($count = 0) { - $choice = $this->in( + $choice = $this->param('force') ? 'Y' : $this->in( sprintf('%d files to process. Continue?', $count), array('Y', 'N'), 'Y' @@ -435,6 +435,11 @@ public function getOptionParser() 'short' => 'i', 'help' => 'Only perform import process.', 'boolean' => true, + ))->addOption('force', array( + 'short' => 'f', + 'help' => 'Disable interactions and answer "yes" to every command.', + 'boolean' => true, + 'default' => false, ))->addOption('update', array( 'short' => 'u', 'help' => 'Only perform update process.',