diff --git a/README.md b/README.md index d3dd87214..ce140b070 100644 --- a/README.md +++ b/README.md @@ -685,46 +685,64 @@ Defaults to all tables registered to the $wpdb database handler. Displays the database name and size. ~~~ -wp db size [--size_format] [--tables] [--format] [--scope=] [--network] [--all-tables-with-prefix] [--all-tables] +wp db size [--size_format=] [--tables] [--human-readable] [--format=] [--scope=] [--network] [--all-tables-with-prefix] [--all-tables] ~~~ Display the database name and size for `DB_NAME` specified in wp-config.php. The size defaults to a human-readable number. +Available size formats include: +* b (bytes) +* kb (kilobytes) +* mb (megabytes) +* gb (gigabytes) +* tb (terabytes) +* B (ISO Byte setting, with no conversion) +* KB (ISO Kilobyte setting, with 1 KB = 1,000 B) +* KiB (ISO Kibibyte setting, with 1 KiB = 1,024 B) +* MB (ISO Megabyte setting, with 1 MB = 1,000 KB) +* MiB (ISO Mebibyte setting, with 1 MiB = 1,024 KiB) +* GB (ISO Gigabyte setting, with 1 GB = 1,000 MB) +* GiB (ISO Gibibyte setting, with 1 GiB = 1,024 MiB) +* TB (ISO Terabyte setting, with 1 TB = 1,000 GB) +* TiB (ISO Tebibyte setting, with 1 TiB = 1,024 GiB) + **OPTIONS** - [--size_format] + [--size_format=] Display the database size only, as a bare number. --- - default: b options: - - b (bytes) - - kb (kilobytes) - - mb (megabytes) - - gb (gigabytes) - - tb (terabytes) - - B (ISO Byte setting, with no conversion) - - KB (ISO Kilobyte setting, with 1 KB = 1,000 B) - - KiB (ISO Kibibyte setting, with 1 KiB = 1,024 B) - - MB (ISO Megabyte setting, with 1 MB = 1,000 KB) - - MiB (ISO Mebibyte setting, with 1 MiB = 1,024 KiB) - - GB (ISO Gigabyte setting, with 1 GB = 1,000 MB) - - GiB (ISO Gibibyte setting, with 1 GiB = 1,024 MiB) - - TB (ISO Terabyte setting, with 1 TB = 1,000 GB) - - TiB (ISO Tebibyte setting, with 1 TiB = 1,024 GiB) - --- + - b + - kb + - mb + - gb + - tb + - B + - KB + - KiB + - MB + - MiB + - GB + - GiB + - TB + - TiB + --- [--tables] Display each table name and size instead of the database size. - [--format] - table, csv, json + [--human-readable] + Display database sizes in human readable formats. + + [--format=] + Render output in a particular format. --- - default: table options: - table - csv - json + - yaml --- [--scope=] diff --git a/src/DB_Command.php b/src/DB_Command.php index afcddbdfd..870a0247e 100644 --- a/src/DB_Command.php +++ b/src/DB_Command.php @@ -659,28 +659,43 @@ public function tables( $args, $assoc_args ) { * Display the database name and size for `DB_NAME` specified in wp-config.php. * The size defaults to a human-readable number. * + * Available size formats include: + * * b (bytes) + * * kb (kilobytes) + * * mb (megabytes) + * * gb (gigabytes) + * * tb (terabytes) + * * B (ISO Byte setting, with no conversion) + * * KB (ISO Kilobyte setting, with 1 KB = 1,000 B) + * * KiB (ISO Kibibyte setting, with 1 KiB = 1,024 B) + * * MB (ISO Megabyte setting, with 1 MB = 1,000 KB) + * * MiB (ISO Mebibyte setting, with 1 MiB = 1,024 KiB) + * * GB (ISO Gigabyte setting, with 1 GB = 1,000 MB) + * * GiB (ISO Gibibyte setting, with 1 GiB = 1,024 MiB) + * * TB (ISO Terabyte setting, with 1 TB = 1,000 GB) + * * TiB (ISO Tebibyte setting, with 1 TiB = 1,024 GiB) + * * ## OPTIONS * - * [--size_format] + * [--size_format=] * : Display the database size only, as a bare number. * --- - * default: b * options: - * - b (bytes) - * - kb (kilobytes) - * - mb (megabytes) - * - gb (gigabytes) - * - tb (terabytes) - * - B (ISO Byte setting, with no conversion) - * - KB (ISO Kilobyte setting, with 1 KB = 1,000 B) - * - KiB (ISO Kibibyte setting, with 1 KiB = 1,024 B) - * - MB (ISO Megabyte setting, with 1 MB = 1,000 KB) - * - MiB (ISO Mebibyte setting, with 1 MiB = 1,024 KiB) - * - GB (ISO Gigabyte setting, with 1 GB = 1,000 MB) - * - GiB (ISO Gibibyte setting, with 1 GiB = 1,024 MiB) - * - TB (ISO Terabyte setting, with 1 TB = 1,000 GB) - * - TiB (ISO Tebibyte setting, with 1 TiB = 1,024 GiB) - * --- + * - b + * - kb + * - mb + * - gb + * - tb + * - B + * - KB + * - KiB + * - MB + * - MiB + * - GB + * - GiB + * - TB + * - TiB + * --- * * [--tables] * : Display each table name and size instead of the database size. @@ -688,14 +703,14 @@ public function tables( $args, $assoc_args ) { * [--human-readable] * : Display database sizes in human readable formats. * - * [--format] - * : table, csv, json + * [--format=] + * : Render output in a particular format. * --- - * default: table * options: * - table * - csv * - json + * - yaml * --- * * [--scope=]