Skip to content

Commit

Permalink
Merge 5d669d9 into bbce692
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellovetro committed Dec 13, 2016
2 parents bbce692 + 5d669d9 commit d5f5368
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/commands/AuditController.php
Expand Up @@ -35,14 +35,19 @@ class AuditController extends Controller
*/
public $age;

/**
* @var bool True to assume Yes to all queries and do not prompt
*/
public $assumeYesAllQuery;

/**
* @inheritdoc
*/
public function options($actionID)
{
return array_merge(
parent::options($actionID),
($actionID == 'cleanup') ? ['entry', 'panels', 'age'] : []
($actionID == 'cleanup') ? ['entry', 'panels', 'age', 'assumeYesAllQuery'] : []
);
}

Expand All @@ -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)) {
Expand Down

0 comments on commit d5f5368

Please sign in to comment.