diff --git a/features/help.feature b/features/help.feature index 175e48737e..1a3c03de32 100644 --- a/features/help.feature +++ b/features/help.feature @@ -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 diff --git a/php/WP_CLI/Dispatcher/CompositeCommand.php b/php/WP_CLI/Dispatcher/CompositeCommand.php index 9fa4e76043..8d4e4f80a7 100644 --- a/php/WP_CLI/Dispatcher/CompositeCommand.php +++ b/php/WP_CLI/Dispatcher/CompositeCommand.php @@ -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'],