Skip to content

Commit db5498e

Browse files
authored
Merge pull request #252 from rolf-yoast/add-alignments
2 parents 471a110 + e83917e commit db5498e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.typos.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[default]
2+
extend-ignore-re = [
3+
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
4+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
5+
"(#|//)\\s*spellchecker:ignore-next-line\\n.*"
6+
]

src/DB_Command.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use WP_CLI\Formatter;
44
use WP_CLI\Utils;
5+
use cli\table\Column;
56

67
/**
78
* Performs basic database operations using credentials stored in wp-config.php.
@@ -1199,7 +1200,6 @@ public function size( $args, $assoc_args ) {
11991200
if ( ! empty( $size_format ) && ! $tables && ! $format && ! $human_readable && true !== $all_tables && true !== $all_tables_with_prefix ) {
12001201
WP_CLI::line( str_replace( " {$size_format_display}", '', $rows[0]['Size'] ) );
12011202
} else {
1202-
12031203
// Sort the rows by user input
12041204
if ( $orderby ) {
12051205
usort(
@@ -1220,7 +1220,8 @@ function ( $a, $b ) use ( $order, $orderby ) {
12201220

12211221
// Display the rows.
12221222
$args = [
1223-
'format' => $format,
1223+
'format' => $format,
1224+
'alignments' => [ 'Size' => Column::ALIGN_RIGHT ],
12241225
];
12251226

12261227
$formatter = new Formatter( $args, $fields );
@@ -1816,7 +1817,7 @@ private static function run( $cmd, $assoc_args = [], $send_to_shell = true, $int
18161817
$required['default-character-set'] = constant( 'DB_CHARSET' );
18171818
}
18181819

1819-
// Using 'dbuser' as option name to workaround clash with WP-CLI's global WP 'user' parameter, with 'dbpass' also available for tidyness.
1820+
// Using 'dbuser' as option name to workaround clash with WP-CLI's global WP 'user' parameter, with 'dbpass' also available for tidiness.
18201821
if ( isset( $assoc_args['dbuser'] ) ) {
18211822
$required['user'] = $assoc_args['dbuser'];
18221823
unset( $assoc_args['dbuser'] );

0 commit comments

Comments
 (0)