Skip to content

Commit 869eb85

Browse files
committed
Update scaffolded files
1 parent a0d6962 commit 869eb85

File tree

3 files changed

+53
-119
lines changed

3 files changed

+53
-119
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ before_install:
4848
echo "xdebug.ini does not exist"
4949
fi
5050
- |
51-
# Raise PHP memory limit to 2048MB.
51+
# Raise PHP memory limit to 2048MB
5252
echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
5353
5454
install:

README.md

Lines changed: 20 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,7 @@ wp comment meta get <id> <key> [--format=<format>]
441441
The name of the meta field to get.
442442

443443
[--format=<format>]
444-
Get value in a particular format.
445-
---
446-
default: var_export
447-
options:
448-
- var_export
449-
- json
450-
- yaml
451-
---
444+
Accepted values: table, json. Default: table
452445

453446

454447

@@ -472,16 +465,7 @@ wp comment meta list <id> [--keys=<keys>] [--fields=<fields>] [--format=<format>
472465
Limit the output to specific row fields. Defaults to id,meta_key,meta_value.
473466

474467
[--format=<format>]
475-
Render output in a particular format.
476-
---
477-
default: table
478-
options:
479-
- table
480-
- csv
481-
- json
482-
- yaml
483-
- count
484-
---
468+
Accepted values: table, csv, json, count. Default: table
485469

486470
[--orderby=<fields>]
487471
Set orderby which field.
@@ -1352,6 +1336,8 @@ wp network meta
13521336

13531337

13541338

1339+
1340+
13551341
### wp network meta add
13561342

13571343
Add a meta field.
@@ -1423,14 +1409,7 @@ wp network meta get <id> <key> [--format=<format>]
14231409
The name of the meta field to get.
14241410

14251411
[--format=<format>]
1426-
Get value in a particular format.
1427-
---
1428-
default: var_export
1429-
options:
1430-
- var_export
1431-
- json
1432-
- yaml
1433-
---
1412+
Accepted values: table, json. Default: table
14341413

14351414

14361415

@@ -1454,16 +1433,7 @@ wp network meta list <id> [--keys=<keys>] [--fields=<fields>] [--format=<format>
14541433
Limit the output to specific row fields. Defaults to id,meta_key,meta_value.
14551434

14561435
[--format=<format>]
1457-
Render output in a particular format.
1458-
---
1459-
default: table
1460-
options:
1461-
- table
1462-
- csv
1463-
- json
1464-
- yaml
1465-
- count
1466-
---
1436+
Accepted values: table, csv, json, count. Default: table
14671437

14681438
[--orderby=<fields>]
14691439
Set orderby which field.
@@ -1734,7 +1704,7 @@ wp option get <key> [--format=<format>]
17341704
Lists options and their values.
17351705

17361706
~~~
1737-
wp option list [--search=<pattern>] [--exclude=<pattern>] [--autoload=<value>] [--transients] [--unserialize] [--field=<field>] [--fields=<fields>] [--format=<format>] [--orderby=<fields>] [--order=<order>]
1707+
wp option list [--search=<pattern>] [--exclude=<pattern>] [--autoload=<value>] [--transients] [--field=<field>] [--fields=<fields>] [--format=<format>] [--orderby=<fields>] [--order=<order>]
17381708
~~~
17391709

17401710
**OPTIONS**
@@ -1751,9 +1721,6 @@ wp option list [--search=<pattern>] [--exclude=<pattern>] [--autoload=<value>] [
17511721
[--transients]
17521722
List only transients. Use `--no-transients` to ignore all transients.
17531723

1754-
[--unserialize]
1755-
Unserialize option values in output.
1756-
17571724
[--field=<field>]
17581725
Prints the value of a single field.
17591726

@@ -2493,14 +2460,7 @@ wp post meta get <id> <key> [--format=<format>]
24932460
The name of the meta field to get.
24942461

24952462
[--format=<format>]
2496-
Get value in a particular format.
2497-
---
2498-
default: var_export
2499-
options:
2500-
- var_export
2501-
- json
2502-
- yaml
2503-
---
2463+
Accepted values: table, json. Default: table
25042464

25052465

25062466

@@ -2524,16 +2484,7 @@ wp post meta list <id> [--keys=<keys>] [--fields=<fields>] [--format=<format>] [
25242484
Limit the output to specific row fields. Defaults to id,meta_key,meta_value.
25252485

25262486
[--format=<format>]
2527-
Render output in a particular format.
2528-
---
2529-
default: table
2530-
options:
2531-
- table
2532-
- csv
2533-
- json
2534-
- yaml
2535-
- count
2536-
---
2487+
Accepted values: table, csv, json, count. Default: table
25372488

25382489
[--orderby=<fields>]
25392490
Set orderby which field.
@@ -2726,17 +2677,7 @@ wp post term list <id> <taxonomy>... [--field=<field>] [--fields=<fields>] [--fo
27262677
Limit the output to specific row fields.
27272678

27282679
[--format=<format>]
2729-
Render output in a particular format.
2730-
---
2731-
default: table
2732-
options:
2733-
- table
2734-
- csv
2735-
- json
2736-
- yaml
2737-
- count
2738-
- ids
2739-
---
2680+
Accepted values: table, csv, json, count, ids. Default: table
27402681

27412682
**AVAILABLE FIELDS**
27422683

@@ -2925,7 +2866,7 @@ wp post update <id>... [--post_author=<post_author>] [--post_date=<post_date>] [
29252866
Success: Updated post 123.
29262867

29272868
# Update a post with multiple meta values.
2928-
$ wp post update 123 --meta_input='{"key1":"value1","key2":"value2"}'
2869+
$ wp post update 123 --meta_input='{"key1":"value1","key2":"value2"}
29292870
Success: Updated post 123.
29302871

29312872

@@ -4042,14 +3983,7 @@ wp term meta get <id> <key> [--format=<format>]
40423983
The name of the meta field to get.
40433984

40443985
[--format=<format>]
4045-
Get value in a particular format.
4046-
---
4047-
default: var_export
4048-
options:
4049-
- var_export
4050-
- json
4051-
- yaml
4052-
---
3986+
Accepted values: table, json. Default: table
40533987

40543988

40553989

@@ -4073,16 +4007,7 @@ wp term meta list <id> [--keys=<keys>] [--fields=<fields>] [--format=<format>] [
40734007
Limit the output to specific row fields. Defaults to id,meta_key,meta_value.
40744008

40754009
[--format=<format>]
4076-
Render output in a particular format.
4077-
---
4078-
default: table
4079-
options:
4080-
- table
4081-
- csv
4082-
- json
4083-
- yaml
4084-
- count
4085-
---
4010+
Accepted values: table, csv, json, count. Default: table
40864011

40874012
[--orderby=<fields>]
40884013
Set orderby which field.
@@ -4380,7 +4305,7 @@ wp user add-role <user> <role>
43804305
Creates a new user.
43814306

43824307
~~~
4383-
wp user create <user-login> <user-email> [--role=<role>] [--user_pass=<password>] [--user_registered=<yyyy-mm-dd-hh-ii-ss>] [--display_name=<name>] [--user_nicename=<nice_name>] [--user_url=<url>] [--nickname=<nickname>] [--first_name=<first_name>] [--last_name=<last_name>] [--description=<description>] [--rich_editing=<rich_editing>] [--send-email] [--porcelain]
4308+
wp user create <user-login> <user-email> [--role=<role>] [--user_pass=<password>] [--user_registered=<yyyy-mm-dd-hh-ii-ss>] [--display_name=<name>] [--user_nicename=<nice_name>] [--user_url=<url>] [--user_email=<email>] [--nickname=<nickname>] [--first_name=<first_name>] [--last_name=<last_name>] [--description=<description>] [--rich_editing=<rich_editing>] [--send-email] [--porcelain]
43844309
~~~
43854310

43864311
**OPTIONS**
@@ -4410,6 +4335,9 @@ wp user create <user-login> <user-email> [--role=<role>] [--user_pass=<password>
44104335
[--user_url=<url>]
44114336
A string containing the user's URL for the user's web site.
44124337

4338+
[--user_email=<email>]
4339+
A string containing the user's email address.
4340+
44134341
[--nickname=<nickname>]
44144342
The user's nickname, defaults to the user's username.
44154343

@@ -4783,13 +4711,7 @@ wp user meta add <user> <key> <value> [--format=<format>]
47834711
The new metadata value.
47844712

47854713
[--format=<format>]
4786-
The serialization format for the value.
4787-
---
4788-
default: plaintext
4789-
options:
4790-
- plaintext
4791-
- json
4792-
---
4714+
The serialization format for the value. Default is plaintext.
47934715

47944716
**EXAMPLES**
47954717

@@ -5017,13 +4939,7 @@ wp user meta update <user> <key> <value> [--format=<format>]
50174939
The new metadata value.
50184940

50194941
[--format=<format>]
5020-
The serialization format for the value.
5021-
---
5022-
default: plaintext
5023-
options:
5024-
- plaintext
5025-
- json
5026-
---
4942+
The serialization format for the value. Default is plaintext.
50274943

50284944
**EXAMPLES**
50294945

@@ -5344,17 +5260,7 @@ wp user term list <id> <taxonomy>... [--field=<field>] [--fields=<fields>] [--fo
53445260
Limit the output to specific row fields.
53455261

53465262
[--format=<format>]
5347-
Render output in a particular format.
5348-
---
5349-
default: table
5350-
options:
5351-
- table
5352-
- csv
5353-
- json
5354-
- yaml
5355-
- count
5356-
- ids
5357-
---
5263+
Accepted values: table, csv, json, count, ids. Default: table
53585264

53595265
**AVAILABLE FIELDS**
53605266

features/bootstrap/utils.php

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function extract_from_phar( $path ) {
2424

2525
$fname = basename( $path );
2626

27-
$tmp_path = get_temp_dir() . "wp-cli-$fname";
27+
$tmp_path = get_temp_dir() . uniqid( 'wp-cli-extract-from-phar-', true ) . "-$fname";
2828

2929
copy( $path, $tmp_path );
3030

@@ -351,19 +351,21 @@ function pick_fields( $item, $fields ) {
351351
* @category Input
352352
*
353353
* @param string $content Some form of text to edit (e.g. post content)
354+
* @param string $title Title to display in the editor.
355+
* @param string $ext Extension to use with the temp file.
354356
* @return string|bool Edited text, if file is saved from editor; false, if no change to file.
355357
*/
356-
function launch_editor_for_input( $input, $filename = 'WP-CLI' ) {
358+
function launch_editor_for_input( $input, $title = 'WP-CLI', $ext = 'tmp' ) {
357359

358360
check_proc_available( 'launch_editor_for_input' );
359361

360362
$tmpdir = get_temp_dir();
361363

362364
do {
363-
$tmpfile = basename( $filename );
365+
$tmpfile = basename( $title );
364366
$tmpfile = preg_replace( '|\.[^.]*$|', '', $tmpfile );
365367
$tmpfile .= '-' . substr( md5( mt_rand() ), 0, 6 );
366-
$tmpfile = $tmpdir . $tmpfile . '.tmp';
368+
$tmpfile = $tmpdir . $tmpfile . '.' . $ext;
367369
$fp = fopen( $tmpfile, 'xb' );
368370
if ( ! $fp && is_writable( $tmpdir ) && file_exists( $tmpfile ) ) {
369371
$tmpfile = '';
@@ -772,6 +774,31 @@ function trailingslashit( $string ) {
772774
return rtrim( $string, '/\\' ) . '/';
773775
}
774776

777+
/**
778+
* Normalize a filesystem path.
779+
*
780+
* On Windows systems, replaces backslashes with forward slashes
781+
* and forces upper-case drive letters.
782+
* Allows for two leading slashes for Windows network shares, but
783+
* ensures that all other duplicate slashes are reduced to a single one.
784+
* Ensures upper-case drive letters on Windows systems.
785+
*
786+
* @access public
787+
* @category System
788+
*
789+
* @param string $path Path to normalize.
790+
* @return string Normalized path.
791+
*/
792+
function normalize_path( $path ) {
793+
$path = str_replace( '\\', '/', $path );
794+
$path = preg_replace( '|(?<=.)/+|', '/', $path );
795+
if ( ':' === substr( $path, 1, 1 ) ) {
796+
$path = ucfirst( $path );
797+
}
798+
return $path;
799+
}
800+
801+
775802
/**
776803
* Convert Windows EOLs to *nix.
777804
*
@@ -1307,6 +1334,7 @@ function get_php_binary() {
13071334

13081335
// Available since PHP 5.4.
13091336
if ( defined( 'PHP_BINARY' ) ) {
1337+
// @codingStandardsIgnoreLine
13101338
return PHP_BINARY;
13111339
}
13121340

0 commit comments

Comments
 (0)