Skip to content

Commit 7d361a1

Browse files
authored
Merge pull request #84 from wp-cli/prerelease-1.3.3
v1.3.3 prerelease: refresh readme, test suite.
2 parents 8dc15fb + 0744007 commit 7d361a1

File tree

5 files changed

+340
-77
lines changed

5 files changed

+340
-77
lines changed

README.md

+125-43
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,21 @@ wp db
4343
Creates a new database.
4444

4545
~~~
46-
wp db create
46+
wp db create [--dbuser=<value>] [--dbpass=<value>]
4747
~~~
4848

4949
Runs `CREATE_DATABASE` SQL statement using `DB_HOST`, `DB_NAME`,
5050
`DB_USER` and `DB_PASSWORD` database credentials specified in
5151
wp-config.php.
5252

53+
**OPTIONS**
54+
55+
[--dbuser=<value>]
56+
Username to pass to mysql. Defaults to DB_USER.
57+
58+
[--dbpass=<value>]
59+
Password to pass to mysql. Defaults to DB_PASSWORD.
60+
5361
**EXAMPLES**
5462

5563
$ wp db create
@@ -62,7 +70,7 @@ wp-config.php.
6270
Deletes the existing database.
6371

6472
~~~
65-
wp db drop [--yes]
73+
wp db drop [--dbuser=<value>] [--dbpass=<value>] [--yes]
6674
~~~
6775

6876
Runs `DROP_DATABASE` SQL statement using `DB_HOST`, `DB_NAME`,
@@ -71,6 +79,12 @@ wp-config.php.
7179

7280
**OPTIONS**
7381

82+
[--dbuser=<value>]
83+
Username to pass to mysql. Defaults to DB_USER.
84+
85+
[--dbpass=<value>]
86+
Password to pass to mysql. Defaults to DB_PASSWORD.
87+
7488
[--yes]
7589
Answer yes to the confirmation message.
7690

@@ -86,7 +100,7 @@ wp-config.php.
86100
Removes all tables from the database.
87101

88102
~~~
89-
wp db reset [--yes]
103+
wp db reset [--dbuser=<value>] [--dbpass=<value>] [--yes]
90104
~~~
91105

92106
Runs `DROP_DATABASE` and `CREATE_DATABASE` SQL statements using
@@ -95,6 +109,12 @@ specified in wp-config.php.
95109

96110
**OPTIONS**
97111

112+
[--dbuser=<value>]
113+
Username to pass to mysql. Defaults to DB_USER.
114+
115+
[--dbpass=<value>]
116+
Password to pass to mysql. Defaults to DB_PASSWORD.
117+
98118
[--yes]
99119
Answer yes to the confirmation message.
100120

@@ -110,7 +130,7 @@ specified in wp-config.php.
110130
Checks the current status of the database.
111131

112132
~~~
113-
wp db check
133+
wp db check [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>]
114134
~~~
115135

116136
Runs `mysqlcheck` utility with `--check` using `DB_HOST`,
@@ -120,6 +140,17 @@ specified in wp-config.php.
120140
[See docs](http://dev.mysql.com/doc/refman/5.7/en/check-table.html)
121141
for more details on the `CHECK TABLE` statement.
122142

143+
**OPTIONS**
144+
145+
[--dbuser=<value>]
146+
Username to pass to mysqlcheck. Defaults to DB_USER.
147+
148+
[--dbpass=<value>]
149+
Password to pass to mysqlcheck. Defaults to DB_PASSWORD.
150+
151+
[--<field>=<value>]
152+
Extra arguments to pass to mysqlcheck.
153+
123154
**EXAMPLES**
124155

125156
$ wp db check
@@ -132,7 +163,7 @@ for more details on the `CHECK TABLE` statement.
132163
Optimizes the database.
133164

134165
~~~
135-
wp db optimize
166+
wp db optimize [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>]
136167
~~~
137168

138169
Runs `mysqlcheck` utility with `--optimize=true` using `DB_HOST`,
@@ -142,6 +173,17 @@ specified in wp-config.php.
142173
[See docs](http://dev.mysql.com/doc/refman/5.7/en/optimize-table.html)
143174
for more details on the `OPTIMIZE TABLE` statement.
144175

176+
**OPTIONS**
177+
178+
[--dbuser=<value>]
179+
Username to pass to mysqlcheck. Defaults to DB_USER.
180+
181+
[--dbpass=<value>]
182+
Password to pass to mysqlcheck. Defaults to DB_PASSWORD.
183+
184+
[--<field>=<value>]
185+
Extra arguments to pass to mysqlcheck.
186+
145187
**EXAMPLES**
146188

147189
$ wp db optimize
@@ -171,7 +213,7 @@ Display the database table prefix, as defined by the database handler's interpre
171213
Repairs the database.
172214

173215
~~~
174-
wp db repair
216+
wp db repair [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>]
175217
~~~
176218

177219
Runs `mysqlcheck` utility with `--repair=true` using `DB_HOST`,
@@ -181,6 +223,17 @@ specified in wp-config.php.
181223
[See docs](http://dev.mysql.com/doc/refman/5.7/en/repair-table.html) for
182224
more details on the `REPAIR TABLE` statement.
183225

226+
**OPTIONS**
227+
228+
[--dbuser=<value>]
229+
Username to pass to mysqlcheck. Defaults to DB_USER.
230+
231+
[--dbpass=<value>]
232+
Password to pass to mysqlcheck. Defaults to DB_PASSWORD.
233+
234+
[--<field>=<value>]
235+
Extra arguments to pass to mysqlcheck.
236+
184237
**EXAMPLES**
185238

186239
$ wp db repair
@@ -193,7 +246,7 @@ more details on the `REPAIR TABLE` statement.
193246
Opens a MySQL console using credentials from wp-config.php
194247

195248
~~~
196-
wp db cli [--database=<database>] [--default-character-set=<character-set>] [--<field>=<value>]
249+
wp db cli [--database=<database>] [--default-character-set=<character-set>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>]
197250
~~~
198251

199252
**OPTIONS**
@@ -204,8 +257,14 @@ wp db cli [--database=<database>] [--default-character-set=<character-set>] [--<
204257
[--default-character-set=<character-set>]
205258
Use a specific character set. Defaults to DB_CHARSET when defined.
206259

260+
[--dbuser=<value>]
261+
Username to pass to mysql. Defaults to DB_USER.
262+
263+
[--dbpass=<value>]
264+
Password to pass to mysql. Defaults to DB_PASSWORD.
265+
207266
[--<field>=<value>]
208-
Extra arguments to pass to the MySQL executable.
267+
Extra arguments to pass to mysql.
209268

210269
**EXAMPLES**
211270

@@ -220,7 +279,7 @@ wp db cli [--database=<database>] [--default-character-set=<character-set>] [--<
220279
Executes a SQL query against the database.
221280

222281
~~~
223-
wp db query [<sql>] [--<field>=<value>]
282+
wp db query [<sql>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>]
224283
~~~
225284

226285
Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER`
@@ -231,6 +290,12 @@ Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER`
231290
[<sql>]
232291
A SQL query. If not passed, will try to read from STDIN.
233292

293+
[--dbuser=<value>]
294+
Username to pass to mysql. Defaults to DB_USER.
295+
296+
[--dbpass=<value>]
297+
Password to pass to mysql. Defaults to DB_PASSWORD.
298+
234299
[--<field>=<value>]
235300
Extra arguments to pass to mysql.
236301

@@ -271,7 +336,7 @@ Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER`
271336
Exports the database to a file or to STDOUT.
272337

273338
~~~
274-
wp db export [<file>] [--<field>=<value>] [--tables=<tables>] [--exclude_tables=<tables>] [--porcelain]
339+
wp db export [<file>] [--dbuser=<value>] [--dbpass=<value>] [--<field>=<value>] [--tables=<tables>] [--exclude_tables=<tables>] [--porcelain]
275340
~~~
276341

277342
Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and
@@ -283,8 +348,14 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and
283348
The name of the SQL file to export. If '-', then outputs to STDOUT. If
284349
omitted, it will be '{dbname}-{Y-m-d}-{random-hash}.sql'.
285350

351+
[--dbuser=<value>]
352+
Username to pass to mysqldump. Defaults to DB_USER.
353+
354+
[--dbpass=<value>]
355+
Password to pass to mysqldump. Defaults to DB_PASSWORD.
356+
286357
[--<field>=<value>]
287-
Extra arguments to pass to mysqldump
358+
Extra arguments to pass to mysqldump.
288359

289360
[--tables=<tables>]
290361
The comma separated list of specific tables to export. Excluding this parameter will export all tables in the database.
@@ -341,7 +412,7 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and
341412
Imports a database from a file or from STDIN.
342413

343414
~~~
344-
wp db import [<file>] [--skip-optimization]
415+
wp db import [<file>] [--dbuser=<value>] [--dbpass=<value>] [--skip-optimization]
345416
~~~
346417

347418
Runs SQL queries using `DB_HOST`, `DB_NAME`, `DB_USER` and
@@ -354,6 +425,12 @@ defined in the SQL.
354425
[<file>]
355426
The name of the SQL file to import. If '-', then reads from STDIN. If omitted, it will look for '{dbname}.sql'.
356427

428+
[--dbuser=<value>]
429+
Username to pass to mysql. Defaults to DB_USER.
430+
431+
[--dbpass=<value>]
432+
Password to pass to mysql. Defaults to DB_PASSWORD.
433+
357434
[--skip-optimization]
358435
When using an SQL file, do not include speed optimization such as disabling auto-commit and key checks.
359436

@@ -437,35 +514,38 @@ Defaults to searching through all tables registered to $wpdb. On multisite, this
437514
Percent color code to use for the match (unless both before and after context are 0, when no color code is used). For a list of available percent color codes, see below. Default '%3%k' (black on a mustard background).
438515

439516
The percent color codes available are:
440-
'%y' Yellow (dark) (mustard)
441-
'%g' Green (dark)
442-
'%b' Blue (dark)
443-
'%r' Red (dark)
444-
'%m' Magenta (dark)
445-
'%c' Cyan (dark)
446-
'%w' White (dark) (light gray)
447-
'%k' Black
448-
'%Y' Yellow (bright)
449-
'%G' Green (bright)
450-
'%B' Blue (bright)
451-
'%R' Red (bright)
452-
'%M' Magenta (bright)
453-
'%C' Cyan (bright)
454-
'%W' White
455-
'%K' Black (bright) (dark gray)
456-
'%3' Yellow background (dark) (mustard)
457-
'%2' Green background (dark)
458-
'%4' Blue background (dark)
459-
'%1' Red background (dark)
460-
'%5' Magenta background (dark)
461-
'%6' Cyan background (dark)
462-
'%7' White background (dark) (light gray)
463-
'%0' Black background
464-
'%8' Reverse
465-
'%U' Underline
466-
'%F' Blink (unlikely to work)
467-
468-
They can be concatenated. For instance, the default match color of black on a mustard (dark yellow) background '%3%k' can be made black on a bright yellow background with '%Y%0%8'.
517+
518+
| Code | Color
519+
| ---- | -----
520+
| %y | Yellow (dark) (mustard)
521+
| %g | Green (dark)
522+
| %b | Blue (dark)
523+
| %r | Red (dark)
524+
| %m | Magenta (dark)
525+
| %c | Cyan (dark)
526+
| %w | White (dark) (light gray)
527+
| %k | Black
528+
| %Y | Yellow (bright)
529+
| %G | Green (bright)
530+
| %B | Blue (bright)
531+
| %R | Red (bright)
532+
| %M | Magenta (bright)
533+
| %C | Cyan (bright)
534+
| %W | White
535+
| %K | Black (bright) (dark gray)
536+
| %3 | Yellow background (dark) (mustard)
537+
| %2 | Green background (dark)
538+
| %4 | Blue background (dark)
539+
| %1 | Red background (dark)
540+
| %5 | Magenta background (dark)
541+
| %6 | Cyan background (dark)
542+
| %7 | White background (dark) (light gray)
543+
| %0 | Black background
544+
| %8 | Reverse
545+
| %U | Underline
546+
| %F | Blink (unlikely to work)
547+
548+
They can be concatenated. For instance, the default match color of black on a mustard (dark yellow) background `%3%k` can be made black on a bright yellow background with `%Y%0%8`.
469549

470550
**EXAMPLES**
471551

@@ -512,7 +592,7 @@ Defaults to all tables registered to the $wpdb database handler.
512592
Can be all, global, ms_global, blog, or old tables. Defaults to all.
513593

514594
[--network]
515-
List all the tables in a multisite install. Overrides --scope=<scope>.
595+
List all the tables in a multisite install.
516596

517597
[--all-tables-with-prefix]
518598
List all tables that match the table prefix even if not registered on $wpdb. Overrides --network.
@@ -570,6 +650,8 @@ The size defaults to a human-readable number.
570650
- b (bytes)
571651
- kb (kilobytes)
572652
- mb (megabytes)
653+
- gb (gigabytes)
654+
- tb (terabytes)
573655
---
574656

575657
[--tables]
@@ -589,7 +671,7 @@ The size defaults to a human-readable number.
589671
Can be all, global, ms_global, blog, or old tables. Defaults to all.
590672

591673
[--network]
592-
List all the tables in a multisite install. Overrides --scope=<scope>.
674+
List all the tables in a multisite install.
593675

594676
[--all-tables-with-prefix]
595677
List all tables that match the table prefix even if not registered on $wpdb. Overrides --network.

0 commit comments

Comments
 (0)