Skip to content

Improve --debug output for WP_CLI::add_command#4985

Merged
schlessera merged 2 commits into
wp-cli:masterfrom
abhijitrakas:feature/diff-command-namespace
Oct 31, 2018
Merged

Improve --debug output for WP_CLI::add_command#4985
schlessera merged 2 commits into
wp-cli:masterfrom
abhijitrakas:feature/diff-command-namespace

Conversation

@abhijitrakas

@abhijitrakas abhijitrakas commented Oct 27, 2018

Copy link
Copy Markdown
Contributor

Related #4937

@schlessera

Copy link
Copy Markdown
Member

This is not necessarily what was meant with #4937, but it is a good change nevertheless.

Comment thread php/class-wp-cli.php Outdated

\WP_CLI::debug( "Adding command: {$name}", 'commands' );
if ( ! empty( $parent ) ) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove the 4 blank lines here, the code complexity or importance does not warrant so much real estate.

Comment thread php/class-wp-cli.php Outdated

$sub_command = trim( str_replace( $parent, '', $name ) );
\WP_CLI::debug( "Adding command: {$sub_command} in {$parent} Namespace", 'commands' );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment thread php/class-wp-cli.php Outdated
\WP_CLI::debug( "Adding command: {$sub_command} in {$parent} Namespace", 'commands' );

} else {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment thread php/class-wp-cli.php Outdated
} else {

\WP_CLI::debug( "Adding command: {$name}", 'commands' );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@schlessera schlessera changed the title Modify debug output for add command Improve --debug output for WP_CLI::add_command Oct 31, 2018
@schlessera schlessera merged commit 748cb6a into wp-cli:master Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants