Skip to content

Commit 0c2f1e8

Browse files
authored
Merge pull request #130 from wp-cli/fix-size-format-arg
Fix `--size_format` argument definition.
2 parents dac2eba + 43cd750 commit 0c2f1e8

File tree

2 files changed

+74
-41
lines changed

2 files changed

+74
-41
lines changed

README.md

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -685,46 +685,64 @@ Defaults to all tables registered to the $wpdb database handler.
685685
Displays the database name and size.
686686

687687
~~~
688-
wp db size [--size_format] [--tables] [--format] [--scope=<scope>] [--network] [--all-tables-with-prefix] [--all-tables]
688+
wp db size [--size_format=<format>] [--tables] [--human-readable] [--format=<format>] [--scope=<scope>] [--network] [--all-tables-with-prefix] [--all-tables]
689689
~~~
690690

691691
Display the database name and size for `DB_NAME` specified in wp-config.php.
692692
The size defaults to a human-readable number.
693693

694+
Available size formats include:
695+
* b (bytes)
696+
* kb (kilobytes)
697+
* mb (megabytes)
698+
* gb (gigabytes)
699+
* tb (terabytes)
700+
* B (ISO Byte setting, with no conversion)
701+
* KB (ISO Kilobyte setting, with 1 KB = 1,000 B)
702+
* KiB (ISO Kibibyte setting, with 1 KiB = 1,024 B)
703+
* MB (ISO Megabyte setting, with 1 MB = 1,000 KB)
704+
* MiB (ISO Mebibyte setting, with 1 MiB = 1,024 KiB)
705+
* GB (ISO Gigabyte setting, with 1 GB = 1,000 MB)
706+
* GiB (ISO Gibibyte setting, with 1 GiB = 1,024 MiB)
707+
* TB (ISO Terabyte setting, with 1 TB = 1,000 GB)
708+
* TiB (ISO Tebibyte setting, with 1 TiB = 1,024 GiB)
709+
694710
**OPTIONS**
695711

696-
[--size_format]
712+
[--size_format=<format>]
697713
Display the database size only, as a bare number.
698714
---
699-
default: b
700715
options:
701-
- b (bytes)
702-
- kb (kilobytes)
703-
- mb (megabytes)
704-
- gb (gigabytes)
705-
- tb (terabytes)
706-
- B (ISO Byte setting, with no conversion)
707-
- KB (ISO Kilobyte setting, with 1 KB = 1,000 B)
708-
- KiB (ISO Kibibyte setting, with 1 KiB = 1,024 B)
709-
- MB (ISO Megabyte setting, with 1 MB = 1,000 KB)
710-
- MiB (ISO Mebibyte setting, with 1 MiB = 1,024 KiB)
711-
- GB (ISO Gigabyte setting, with 1 GB = 1,000 MB)
712-
- GiB (ISO Gibibyte setting, with 1 GiB = 1,024 MiB)
713-
- TB (ISO Terabyte setting, with 1 TB = 1,000 GB)
714-
- TiB (ISO Tebibyte setting, with 1 TiB = 1,024 GiB)
715-
---
716+
- b
717+
- kb
718+
- mb
719+
- gb
720+
- tb
721+
- B
722+
- KB
723+
- KiB
724+
- MB
725+
- MiB
726+
- GB
727+
- GiB
728+
- TB
729+
- TiB
730+
---
716731

717732
[--tables]
718733
Display each table name and size instead of the database size.
719734

720-
[--format]
721-
table, csv, json
735+
[--human-readable]
736+
Display database sizes in human readable formats.
737+
738+
[--format=<format>]
739+
Render output in a particular format.
722740
---
723-
default: table
724741
options:
725742
- table
726743
- csv
727744
- json
745+
- yaml
728746
---
729747

730748
[--scope=<scope>]

src/DB_Command.php

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -659,43 +659,58 @@ public function tables( $args, $assoc_args ) {
659659
* Display the database name and size for `DB_NAME` specified in wp-config.php.
660660
* The size defaults to a human-readable number.
661661
*
662+
* Available size formats include:
663+
* * b (bytes)
664+
* * kb (kilobytes)
665+
* * mb (megabytes)
666+
* * gb (gigabytes)
667+
* * tb (terabytes)
668+
* * B (ISO Byte setting, with no conversion)
669+
* * KB (ISO Kilobyte setting, with 1 KB = 1,000 B)
670+
* * KiB (ISO Kibibyte setting, with 1 KiB = 1,024 B)
671+
* * MB (ISO Megabyte setting, with 1 MB = 1,000 KB)
672+
* * MiB (ISO Mebibyte setting, with 1 MiB = 1,024 KiB)
673+
* * GB (ISO Gigabyte setting, with 1 GB = 1,000 MB)
674+
* * GiB (ISO Gibibyte setting, with 1 GiB = 1,024 MiB)
675+
* * TB (ISO Terabyte setting, with 1 TB = 1,000 GB)
676+
* * TiB (ISO Tebibyte setting, with 1 TiB = 1,024 GiB)
677+
*
662678
* ## OPTIONS
663679
*
664-
* [--size_format]
680+
* [--size_format=<format>]
665681
* : Display the database size only, as a bare number.
666682
* ---
667-
* default: b
668683
* options:
669-
* - b (bytes)
670-
* - kb (kilobytes)
671-
* - mb (megabytes)
672-
* - gb (gigabytes)
673-
* - tb (terabytes)
674-
* - B (ISO Byte setting, with no conversion)
675-
* - KB (ISO Kilobyte setting, with 1 KB = 1,000 B)
676-
* - KiB (ISO Kibibyte setting, with 1 KiB = 1,024 B)
677-
* - MB (ISO Megabyte setting, with 1 MB = 1,000 KB)
678-
* - MiB (ISO Mebibyte setting, with 1 MiB = 1,024 KiB)
679-
* - GB (ISO Gigabyte setting, with 1 GB = 1,000 MB)
680-
* - GiB (ISO Gibibyte setting, with 1 GiB = 1,024 MiB)
681-
* - TB (ISO Terabyte setting, with 1 TB = 1,000 GB)
682-
* - TiB (ISO Tebibyte setting, with 1 TiB = 1,024 GiB)
683-
* ---
684+
* - b
685+
* - kb
686+
* - mb
687+
* - gb
688+
* - tb
689+
* - B
690+
* - KB
691+
* - KiB
692+
* - MB
693+
* - MiB
694+
* - GB
695+
* - GiB
696+
* - TB
697+
* - TiB
698+
* ---
684699
*
685700
* [--tables]
686701
* : Display each table name and size instead of the database size.
687702
*
688703
* [--human-readable]
689704
* : Display database sizes in human readable formats.
690705
*
691-
* [--format]
692-
* : table, csv, json
706+
* [--format=<format>]
707+
* : Render output in a particular format.
693708
* ---
694-
* default: table
695709
* options:
696710
* - table
697711
* - csv
698712
* - json
713+
* - yaml
699714
* ---
700715
*
701716
* [--scope=<scope>]

0 commit comments

Comments
 (0)