Skip to content

Support --format=<format> argument for wp cap list#2851

Merged
danielbachhuber merged 8 commits into
wp-cli:masterfrom
ernilambar:2847-format-param-cap-list
May 27, 2016
Merged

Support --format=<format> argument for wp cap list#2851
danielbachhuber merged 8 commits into
wp-cli:masterfrom
ernilambar:2847-format-param-cap-list

Conversation

@ernilambar
Copy link
Copy Markdown
Member

See #2847

Comment thread php/commands/cap.php
$role_obj = self::get_role( $args[0] );

foreach ( array_keys( $role_obj->capabilities ) as $cap )
WP_CLI::line( $cap );
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.

This should still be the default format.

Comment thread php/commands/cap.php Outdated

foreach ( array_keys( $role_obj->capabilities ) as $cap )
WP_CLI::line( $cap );
if ( ! isset( $assoc_args['format'] ) || in_array( $assoc_args['format'], array( 'list' ) ) ) {
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.

Because $assoc_args['format'] will always be set, this can just be:

if ( 'list' === $assoc_args['format'] )

@danielbachhuber
Copy link
Copy Markdown
Member

@ernilambar One remaining tweak

@danielbachhuber danielbachhuber changed the title 2847 format param cap list Support --format=<format> argument for wp cap list May 27, 2016
@danielbachhuber danielbachhuber merged commit bd65f31 into wp-cli:master May 27, 2016
@ernilambar ernilambar deleted the 2847-format-param-cap-list branch May 27, 2016 15:44
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