Skip to content

Commit a7fce11

Browse files
committed
Fix date format option naming in watchdog:show command
1 parent 1141405 commit a7fce11

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Commands/core/WatchdogCommands.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(protected Connection $connection)
4747
#[CLI\Option(name: 'severity-min', description: 'Restrict to messages of a given severity level and higher.')]
4848
#[CLI\Option(name: 'type', description: 'Restrict to messages of a given type.')]
4949
#[CLI\Option(name: 'extended', description: 'Return extended information about each message.')]
50-
#[CLI\Option(name: 'date_format', description: 'Specify a date format for the date console output.')]
50+
#[CLI\Option(name: 'date-format', description: 'Specify a date format for the date console output.')]
5151
#[CLI\Usage(name: 'drush watchdog:show', description: 'Show a listing of most recent 10 messages.')]
5252
#[CLI\Usage(name: 'drush watchdog:show "cron run successful"', description: 'Show a listing of most recent 10 messages containing the string <info>cron run successful</info>.')]
5353
#[CLI\Usage(name: 'drush watchdog:show --count=46', description: 'Show a listing of most recent 46 messages.')]
@@ -71,7 +71,7 @@ public function __construct(protected Connection $connection)
7171
#[CLI\DefaultTableFields(fields: ['wid', 'date', 'type', 'severity', 'message'])]
7272
#[CLI\Complete(method_name_or_callable: 'watchdogComplete')]
7373
#[CLI\Bootstrap(level: DrupalBootLevels::FULL)]
74-
public function show($substring = '', $options = ['format' => 'table', 'count' => 10, 'severity' => self::REQ, 'severity-min' => self::REQ, 'type' => self::REQ, 'extended' => false, 'date_format' => 'd/M H:i']): ?RowsOfFields
74+
public function show($substring = '', $options = ['format' => 'table', 'count' => 10, 'severity' => self::REQ, 'severity-min' => self::REQ, 'type' => self::REQ, 'extended' => false, 'date-format' => 'd/M H:i']): ?RowsOfFields
7575
{
7676
$where = $this->where((string)$options['type'], $options['severity'], $substring, 'AND', $options['severity-min']);
7777
$query = $this->connection->select('watchdog', 'w')
@@ -83,7 +83,7 @@ public function show($substring = '', $options = ['format' => 'table', 'count' =
8383
}
8484
$rsc = $query->execute();
8585
while ($result = $rsc->fetchObject()) {
86-
$row = $this->formatResult($result, $options['extended'], $options['date_format']);
86+
$row = $this->formatResult($result, $options['extended'], $options['date-format']);
8787
$table[$row->wid] = (array)$row;
8888
}
8989
if (empty($table)) {

0 commit comments

Comments
 (0)