diff --git a/src/commands/AuditController.php b/src/commands/AuditController.php index 9e6a2d84..8d151241 100644 --- a/src/commands/AuditController.php +++ b/src/commands/AuditController.php @@ -35,6 +35,11 @@ class AuditController extends Controller */ public $age; + /** + * @var bool True to assume Yes to all queries and do not prompt + */ + public $assumeYesAllQuery; + /** * @inheritdoc */ @@ -42,7 +47,7 @@ public function options($actionID) { return array_merge( parent::options($actionID), - ($actionID == 'cleanup') ? ['entry', 'panels', 'age'] : [] + ($actionID == 'cleanup') ? ['entry', 'panels', 'age', 'assumeYesAllQuery'] : [] ); } @@ -58,10 +63,11 @@ public function actionCleanup() $panels = $this->panels !== null ? explode(',', $this->panels) : array_keys($audit->panels); // summary - $this->preCleanupSummary($this->entry, $panels, $this->age); + $this->preCleanupSummary($this->entry, $panels, $this->age, $this->assumeYesAllQuery); + $assumeYesAllQuery = strtolower($this->assumeYesAllQuery) == "true"; // confirm - if ($this->confirm('Cleanup the above data?')) { + if ($assumeYesAllQuery || $this->confirm('Cleanup the above data?')) { // cleanup panels foreach ($panels as $id) { if (!$this->cleanupPanel($id, $this->age)) {