Skip to content

Commit

Permalink
Merge pull request #11329 from nanaya/remove-yes
Browse files Browse the repository at this point in the history
Remove redundant command option
  • Loading branch information
notbakaneko authored Jul 16, 2024
2 parents a995d5d + a916f54 commit 5e28611
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/Console/Commands/BeatmapLeadersRefresh.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BeatmapLeadersRefresh extends Command
*
* @var string
*/
protected $signature = 'beatmap-leaders:refresh {--yes}';
protected $signature = 'beatmap-leaders:refresh';

/**
* The console command description.
Expand All @@ -35,7 +35,7 @@ class BeatmapLeadersRefresh extends Command
*/
public function handle()
{
$continue = $this->option('yes') || $this->confirm('This will recalculate beatmap leaders, continue?', true);
$continue = $this->option('no-interaction') || $this->confirm('This will recalculate beatmap leaders, continue?', true);

if (!$continue) {
return $this->error('User aborted!');
Expand Down
6 changes: 2 additions & 4 deletions app/Console/Commands/EsIndexDocuments.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class EsIndexDocuments extends Command
*
* @var string
*/
protected $signature = 'es:index-documents {--types=} {--inplace} {--cleanup} {--yes}';
protected $signature = 'es:index-documents {--types=} {--inplace} {--cleanup}';

/**
* The console command description.
Expand All @@ -39,7 +39,6 @@ class EsIndexDocuments extends Command
protected $cleanup;
protected $inplace;
protected $groups;
protected $yes;

/**
* Execute the console command.
Expand Down Expand Up @@ -136,7 +135,6 @@ protected function readOptions()
{
$this->inplace = $this->option('inplace');
$this->cleanup = $this->option('cleanup');
$this->yes = $this->option('yes');

if ($this->option('types')) {
$types = explode(',', $this->option('types'));
Expand Down Expand Up @@ -169,6 +167,6 @@ protected function starterMessage(array $oldIndices)
$confirmMessage = 'This will create new indices';
}

return $this->yes || $this->confirm("{$confirmMessage}, begin indexing?", true);
return $this->option('no-interaction') || $this->confirm("{$confirmMessage}, begin indexing?", true);
}
}
6 changes: 2 additions & 4 deletions app/Console/Commands/EsIndexWiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class EsIndexWiki extends Command
*
* @var string
*/
protected $signature = 'es:index-wiki {--create-only} {--inplace} {--cleanup} {--yes}';
protected $signature = 'es:index-wiki {--create-only} {--inplace} {--cleanup}';

/**
* The console command description.
Expand All @@ -36,7 +36,6 @@ class EsIndexWiki extends Command
private $indexName;
private $indicesToRemove;
private $inplace;
private $yes;

public function handle()
{
Expand Down Expand Up @@ -101,7 +100,6 @@ private function readOptions()
$this->createOnly = $this->option('create-only');
$this->inplace = $this->option('inplace');
$this->cleanup = $this->option('cleanup');
$this->yes = $this->option('yes');
}

private function reindex()
Expand Down Expand Up @@ -165,7 +163,7 @@ private function starterMessage()
);
}

return $this->yes || $this->confirm("This index to {$this->indexName}, begin indexing?", true);
return $this->option('no-interaction') || $this->confirm("This index to {$this->indexName}, begin indexing?", true);
}

private function updateSitemap()
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Commands/ForumTopicCoversCleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ForumTopicCoversCleanup extends Command
*
* @var string
*/
protected $signature = 'forum:topic-cover-cleanup {--maxdays=} {--yes}';
protected $signature = 'forum:topic-cover-cleanup {--maxdays=}';

/**
* The console command description.
Expand All @@ -34,7 +34,7 @@ public function handle()
$createdBefore = now()->subDays(get_int($this->option('maxdays')) ?? 30);
$this->line("This will delete unused topic covers before {$createdBefore}.");

if (!$this->option('yes') && !$this->confirm('Proceed?', true)) {
if (!$this->option('no-interaction') && !$this->confirm('Proceed?', true)) {
$this->error('Aborted.');
return;
}
Expand Down
3 changes: 1 addition & 2 deletions app/Console/Commands/MigrateFreshAllCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function handle()
$this->warn("{$name} => {$config['database']}");
}

$continue = $this->option('yes') || $this->confirm('continue?', true);
$continue = $this->option('no-interaction') || $this->confirm('continue?', true);
if (!$continue) {
$this->error('User aborted!');
return 1;
Expand Down Expand Up @@ -78,7 +78,6 @@ protected function getOptions()
['path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to be executed.'],
['seed', null, InputOption::VALUE_NONE, 'Indicates if the seed task should be re-run.'],
['seeder', null, InputOption::VALUE_OPTIONAL, 'The class name of the root seeder.'],
['yes', null, InputOption::VALUE_NONE, 'Skip the confirmation prompt.'],
];
}
}

0 comments on commit 5e28611

Please sign in to comment.