Skip to content

Commit 64b536e

Browse files
authored
Merge pull request #62 from wp-cli/60-drop-in
Colorize and add a legend to listed drop-ins
2 parents 994f36f + 5fc94c1 commit 64b536e

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

features/plugin-status.feature

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Feature: List the status of plugins
2+
3+
@require-wp-4.0
4+
Scenario: Status should include drop-ins
5+
Given a WP install
6+
And a wp-debug.php file:
7+
"""
8+
<?php
9+
define( 'WP_DEBUG', true );
10+
"""
11+
And a wp-cli.yml file:
12+
"""
13+
require:
14+
- wp-debug.php
15+
"""
16+
And a wp-content/db-error.php file:
17+
"""
18+
<?php
19+
"""
20+
21+
When I run `wp plugin status`
22+
Then STDOUT should contain:
23+
"""
24+
D db-error.php
25+
"""
26+
And STDOUT should contain:
27+
"""
28+
D = Drop-In
29+
"""
30+
And STDERR should be empty

src/WP_CLI/CommandWithUpgrade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,13 +485,15 @@ protected function get_update_info( $slug ) {
485485
'active-network' => 'N',
486486
'must-use' => 'M',
487487
'parent' => 'P',
488+
'dropin' => 'D',
488489
),
489490
'long' => array(
490491
'inactive' => 'Inactive',
491492
'active' => 'Active',
492493
'active-network' => 'Network Active',
493494
'must-use' => 'Must Use',
494495
'parent' => 'Parent',
496+
'dropin' => 'Drop-In',
495497
)
496498
);
497499

@@ -506,6 +508,7 @@ private function get_color( $status ) {
506508
'active-network' => '%g',
507509
'must-use' => '%c',
508510
'parent' => '%p',
511+
'dropin' => '%B',
509512
);
510513

511514
return $colors[ $status ];

0 commit comments

Comments
 (0)