Skip to content

Commit 1f3c20d

Browse files
Colorize and add a legend to listed drop-ins
1 parent 994f36f commit 1f3c20d

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

features/plugin-status.feature

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