Only suppress global parameters if set as true by austinginder · Pull Request #5455 · wp-cli/wp-cli

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only suppress global parameters if set as true #5455

Changes from all commits

Commits

File filter

Filter by extension

Conversations

Failed to load comments.

Loading

Jump to

Jump to file

Failed to load files.

Loading

Diff view
Diff view

15 changes: 15 additions & 0 deletions features/help.feature

Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ Feature: Get help about WP-CLI commands
Path to the WordPress files.
"""

When I run `WP_CLI_SUPPRESS_GLOBAL_PARAMS=false wp help`
Then STDOUT should contain:
"""
GLOBAL PARAMETERS
"""

And STDOUT should contain:
"""
--path
"""
And STDOUT should contain:
"""
Path to the WordPress files.
"""

# Prior to WP 4.3 widgets & others used PHP 4 style constructors and prior to WP 3.9 wpdb used the mysql extension which can all lead (depending on PHP version) to PHP Deprecated notices.
@require-wp-4.3
Scenario: Help for internal commands with WP
Expand Down

2 changes: 1 addition & 1 deletion php/WP_CLI/Dispatcher/CompositeCommand.php

Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ protected function get_global_params( $root_command = false ) {
}

// Check if global parameters synopsis should be displayed or not.
if ( true !== (bool) getenv( 'WP_CLI_SUPPRESS_GLOBAL_PARAMS' ) ) {
if ( 'true' !== getenv( 'WP_CLI_SUPPRESS_GLOBAL_PARAMS' ) ) {
$binding['parameters'][] = array(
'synopsis' => $synopsis,
'desc' => $details['desc'],
Expand Down